/* * 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'; import { isRenotePacked } from '@/misc/is-renote.js'; import { getNoteSummary } from '@/misc/get-note-summary.js'; export function NotePage(props: CommonProps<{ note: Packed<'Note'>; profile: MiUserProfile; }>) { const title = props.note.user.name ? `${props.note.user.name} (@${props.note.user.username}${props.note.user.host ? `@${props.note.user.host}` : ''})` : `@${props.note.user.username}${props.note.user.host ? `@${props.note.user.host}` : ''}` const isRenote = isRenotePacked(props.note); const images = (props.note.files ?? []).filter(f => f.type.startsWith('image/')); const videos = (props.note.files ?? []).filter(f => f.type.startsWith('video/')); const summary = getNoteSummary(props.note); function ogBlock() { return ( <> {videos.map(video => ( <> {video.thumbnailUrl ? : null} {video.properties.width != null ? : null} {video.properties.height != null ? : null} ))} {images.length > 0 ? ( <> {images.map(image => ( <> {image.properties.width != null ? : null} {image.properties.height != null ? : null} ))} ) : ( <> )} ); } function metaBlock() { return ( <> {props.note.user.host != null || isRenote || props.profile.noCrawle ? : null} {props.profile.preventAiLearning ? ( <> ) : null} {props.federationEnabled ? ( <> {props.note.user.host == null ? : null} {props.note.uri != null ? : null} ) : null} ); } return ( ) }