import { lazy, Suspense, useEffect, useState } from 'react'; import { AnimationBoundary } from '../animation/core/AnimationBoundary'; import { useAnimation } from '../animation/orchestration/AnimationProvider'; import type { DesktopState } from '../animation/core/contracts.mjs'; import type { DemoIntent } from './demo-intent.mjs'; import '../styles/demo-companion.css'; const DesktopCharacter = lazy(() => import('../animation/desktop/DesktopCharacter').then(module => ({ default: module.DesktopCharacter }))); const states: Record<'idle' | 'pending' | 'accepted' | 'error', DesktopState> = { idle: 'demo-invite', pending: 'thinking', accepted: 'demo-success', error: 'confused' }; export function DemoCompanion({ status, intent }: { status: keyof typeof states; intent: DemoIntent | null }) { const { state } = useAnimation(); const [enhanced, setEnhanced] = useState(false); useEffect(() => { setEnhanced(true); }, []); const poster = ; const line = status === 'pending' ? 'I’m keeping an eye on your request.' : status === 'accepted' ? 'A good first step. Even I’m impressed.' : status === 'error' ? 'Your details are still here. Let’s check what happened below.' : intent ? `We’re talking about ${intent.label}. Tell the human a little more.` : 'Tell me about your business. The human handles the clever part.'; return ; }