import { useEffect, useRef, type ReactNode } from 'react'; import { X, LoaderCircle, AlertCircle, ArrowUpRight, AudioLines } from 'lucide-react'; import type { Character } from '../api/types'; import { assetUrl } from '../api/client'; export function ErrorNotice({ error }: { error: unknown }) { return error ? (
{error instanceof Error ? error.message : String(error)}
) : null; } export function Loading() { return (
Loading your studio…
); } export function Avatar({ character, large = false }: { character: Character; large?: boolean }) { return (
{character.image_asset_id ? ( {character.name} ) : ( {character.name .split(/[ .]+/) .map((n) => n[0]) .slice(0, 2) .join('')} )}
); } export function PageTitle({ eyebrow, title, description, action, }: { eyebrow: string; title: string; description: string; action?: ReactNode; }) { return (
{eyebrow}

{title}

{description}

{action}
); } export function Empty({ title, children }: { title: string; children: ReactNode }) { return (

{title}

{children}

); } export function Modal({ title, children, onClose, }: { title: string; children: ReactNode; onClose: () => void; }) { const ref = useRef(null); useEffect(() => { ref.current?.showModal(); }, []); return (

{title}

{children}
); } export function External({ href, children }: { href: string; children: ReactNode }) { return ( {children} ); }