import Image from "next/image"; import type { Artist } from "@/types/artist"; import { cn } from "@/lib/cn"; interface ArtistPortraitProps { artist: Artist; className?: string; /** 圆角覆盖 */ rounded?: string; } /** * 艺人立绘容器。 * 有真实图时显示 Image;否则渲染统一品牌紫渐变占位(带英文首字母)。 */ export default function ArtistPortrait({ artist, className, rounded = "rounded-lg", }: ArtistPortraitProps) { const initial = artist.enName?.charAt(0).toUpperCase() || artist.name?.charAt(0) || "?"; if (artist.portrait) { return (
{`${artist.name}
); } // 无立绘 fallback:品牌紫渐变 + 字母占位 return (
{initial}
); }