import { AudioLines, BadgeCheck, Image as ImageIcon, UserRound, Volume2 } from "lucide-react"; import { AppModal } from "@/components/ui/product/app-modal"; import type { ReactNode } from "react"; import type { CanvasNodeData } from "@/types/canvas"; export function CanvasCharacterReferenceModal({ node, open, onClose }: { node: CanvasNodeData | null; open: boolean; onClose: () => void }) { if (!node) return null; const metadata = node.metadata; const definition = metadata?.characterDefinition || {}; const name = metadata?.characterName || node.title || "未命名角色"; const aliases = metadata?.characterAliases || stringList(definition.aliases); const visualReady = metadata?.characterVisualStatus === "ready"; const voiceReady = metadata?.characterVoiceStatus === "ready"; const voiceProfile = metadata?.characterVoiceProfile; return (
人物三视图 } ready={visualReady} readyLabel="形象已绑定" emptyLabel="形象待完善" />
{metadata?.characterCoverUrl ? (
{`${name}人物三视图`}
) : (

尚未绑定人物三视图

)}
); } function DetailSection({ icon, title, children }: { icon: ReactNode; title: string; children: ReactNode }) { return (
{icon} {title}
{children}
); } function DetailRow({ label, value, emphasis = false }: { label: string; value?: string; emphasis?: boolean }) { return (
{label}
{value || "未设置"}
); } function StatusDot({ icon, ready, readyLabel, emptyLabel }: { icon: ReactNode; ready: boolean; readyLabel: string; emptyLabel: string }) { return ( {icon} {ready ? readyLabel : emptyLabel} ); } function stringValue(value: unknown) { return typeof value === "string" ? value.trim() : ""; } function stringList(value: unknown) { return Array.isArray(value) ? value.map(stringValue).filter(Boolean) : []; }