2025-12-17 10:13:47 +00:00
|
|
|
import ChatButton from './ChatButton';
|
2025-12-18 10:14:12 +00:00
|
|
|
import { fetchCharacter } from './service';
|
|
|
|
|
import { Chip } from '@/components/ui/chip';
|
|
|
|
|
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
2025-12-19 03:28:16 +00:00
|
|
|
import { IconButton } from '@/components/ui/button';
|
|
|
|
|
import Link from 'next/link';
|
2025-12-15 11:31:18 +00:00
|
|
|
|
2025-12-09 09:13:46 +00:00
|
|
|
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
|
2025-12-15 11:31:18 +00:00
|
|
|
const { id } = await params;
|
2025-12-18 10:14:12 +00:00
|
|
|
const character = await fetchCharacter(id);
|
2025-12-15 11:31:18 +00:00
|
|
|
|
2025-12-09 09:13:46 +00:00
|
|
|
return (
|
2025-12-19 03:28:16 +00:00
|
|
|
<div className="flex h-full flex-col items-center mx-auto max-w-[752px] px-4 pt-4 sm:pt-10">
|
|
|
|
|
{/* header */}
|
|
|
|
|
<div className="w-full flex mb-4 items-center justify-between">
|
|
|
|
|
<Link href="/home">
|
|
|
|
|
<IconButton variant="ghost" size="large" iconfont="icon-arrow-left" />
|
|
|
|
|
</Link>
|
|
|
|
|
<IconButton variant="tertiary" size="large" iconfont="icon-Like" />
|
|
|
|
|
</div>
|
|
|
|
|
{/* 内容区 */}
|
2025-12-19 07:22:35 +00:00
|
|
|
<div className="mx-auto flex-1 overflow-auto w-full">
|
2025-12-18 10:14:12 +00:00
|
|
|
<header className="flex items-end gap-10 justify-between">
|
2025-12-19 03:28:16 +00:00
|
|
|
<div className="flex flex-1 sm:flex-row flex-col gap-6 items-center sm:items-end">
|
2025-12-18 10:14:12 +00:00
|
|
|
<Avatar className="size-32">
|
|
|
|
|
<AvatarImage src={character?.headPortrait} />
|
|
|
|
|
<AvatarFallback>{character?.name?.slice(0, 2)}</AvatarFallback>
|
2025-12-15 11:31:18 +00:00
|
|
|
</Avatar>
|
2025-12-19 03:28:16 +00:00
|
|
|
<div className="text-center sm:text-left">
|
2025-12-18 10:14:12 +00:00
|
|
|
<div className="txt-headline-s">{character?.name}</div>
|
2025-12-19 03:28:16 +00:00
|
|
|
<div className="flex flex-wrap mt-4 gap-2 justify-center sm:justify-start">
|
2025-12-18 10:14:12 +00:00
|
|
|
{character?.tags?.map((tag: any) => (
|
|
|
|
|
<Chip className="rounded-xs" key={tag.tagId}>
|
|
|
|
|
{tag.name}
|
|
|
|
|
</Chip>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
2025-12-15 11:31:18 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-19 03:28:16 +00:00
|
|
|
<div className="sm:block hidden">
|
2025-12-17 10:13:47 +00:00
|
|
|
<ChatButton id={id}></ChatButton>
|
2025-12-15 11:31:18 +00:00
|
|
|
</div>
|
|
|
|
|
</header>
|
2025-12-19 03:28:16 +00:00
|
|
|
<div className="w-full flex bg-white/10 rounded-m py-3 mt-12">
|
|
|
|
|
<div className="w-full flex items-center flex-col">
|
|
|
|
|
<div className="text-white">
|
|
|
|
|
<IconButton variant="ghost" size="small" iconfont="icon-Like-fill" />
|
|
|
|
|
9.9k
|
|
|
|
|
</div>
|
|
|
|
|
<div className="text-txt-tertiary">Liked</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="w-full flex items-center flex-col">
|
|
|
|
|
<div className="text-[rgba(255,64,180,1)]">
|
|
|
|
|
<IconButton
|
|
|
|
|
className="text-[rgba(255,64,180,1)]"
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="small"
|
|
|
|
|
iconfont="icon-icon_im_other"
|
|
|
|
|
/>
|
|
|
|
|
123456
|
|
|
|
|
</div>
|
|
|
|
|
<div className="text-txt-tertiary">Hot</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="mt-4 rounded-2xl bg-white/10 p-6">
|
2025-12-15 11:31:18 +00:00
|
|
|
<div className="txt-headline-s">Introduction</div>
|
2025-12-18 10:14:12 +00:00
|
|
|
<div className="mt-4">{character?.description}</div>
|
2025-12-15 11:31:18 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-19 03:28:16 +00:00
|
|
|
<div className="sm:hidden w-full mb-4">
|
|
|
|
|
<ChatButton className="w-full" id={id}></ChatButton>
|
|
|
|
|
</div>
|
2025-12-09 09:13:46 +00:00
|
|
|
</div>
|
2025-12-15 11:31:18 +00:00
|
|
|
);
|
2025-12-09 09:13:46 +00:00
|
|
|
}
|