import { formatDateTime } from "@/components/SearchResults"; import { treaty } from "@elysiajs/eden"; import type { App } from "@backend/src"; // @ts-expect-error anyway... const app = treaty(import.meta.env.VITE_API_URL!); type VideosResponse = Awaited["get"]>>["data"]; interface VideoInfoProps { video: Exclude[number]; } export function VideoInfo({ video }: VideoInfoProps) { const formatDuration = (duration: number) => { return `${Math.floor(duration / 60)}:${(duration % 60).toString().padStart(2, "0")}`; }; return (
{video.cover_url && ( Video cover )}

{video.bvid} · av{video.aid}

发布于 {formatDateTime(new Date(video.published_at!))}
播放:{(video.views ?? 0).toLocaleString()} 时长:{formatDuration(video.duration || 0)}

UP主: {video.username}

标签
{video.tags?.replaceAll(",", ",")}

简介

					{video.description || "暂无简介"}
				
); }