/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { Packed } from '@/misc/json-schema.js';
import type { MiUserProfile } from '@/models/UserProfile.js';
import type { CommonProps } from '@/server/web/views/_.js';
import { Layout } from '@/server/web/views/base.js';
export function UserPage(props: CommonProps<{
user: Packed<'UserDetailed'>;
profile: MiUserProfile;
sub?: string;
}>) {
const title = props.user.name ? `${props.user.name} (@${props.user.username}${props.user.host ? `@${props.user.host}` : ''})` : `@${props.user.username}${props.user.host ? `@${props.user.host}` : ''}`;
const me = props.profile.fields
? props.profile.fields
.filter(field => field.value != null && field.value.match(/^https?:/))
.map(field => field.value)
: [];
function ogBlock() {
return (
<>
{props.user.description != null ? : null}
>
);
}
function metaBlock() {
return (
<>
{props.user.host != null || props.profile.noCrawle ? : null}
{props.profile.preventAiLearning ? (
<>
>
) : null}
{props.sub == null && props.federationEnabled ? (
<>
{props.user.host == null ? : null}
{props.user.uri != null ? : null}
{props.profile.url != null ? : null}
>
) : null}
{me.map((url) => (
))}
>
);
}
return (
);
}