import { useId, useRef } from 'react'; import { useMascotAnimation } from '../../hooks/useMascotAnimation'; export const MASCOT_PALETTES = { idle: { from: '#c8f0de', to: '#6dbf96', shadow: 'rgba(168,216,192,0.13)', blush: '#f5a8a8' }, sleeping: { from: '#ddd4f0', to: '#a898cc', shadow: 'rgba(180,160,210,0.1)', blush: '#d8a0c0' }, excited: { from: '#fde0c8', to: '#e8a870', shadow: 'rgba(240,176,128,0.13)', blush: '#f5a8a8' }, lonely: { from: '#c0dced', to: '#78aec8', shadow: 'rgba(120,174,200,0.1)', blush: '#a0a0b8' }, } as const; export type MascotState = keyof typeof MASCOT_PALETTES; interface MascotProps { state: MascotState; className?: string; } interface SvgProps { palette: (typeof MASCOT_PALETTES)[MascotState]; gradientId: string; svgRef: React.Ref; } function IdleSvg({ palette, gradientId, svgRef }: SvgProps) { return ( ); } function SleepingSvg({ palette, gradientId, svgRef }: SvgProps) { return ( ); } function ExcitedSvg({ palette, gradientId, svgRef }: SvgProps) { return ( ); } function LonelySvg({ palette, gradientId, svgRef }: SvgProps) { return ( ); } export function Mascot({ state, className }: MascotProps) { const uid = useId(); const gradientId = `mascot-grad-${uid.replace(/:/g, '')}`; const palette = MASCOT_PALETTES[state]; const svgRef = useRef(null); const containerRef = useRef(null); useMascotAnimation(svgRef, containerRef, state); return (
{state === 'idle' && } {state === 'sleeping' && } {state === 'excited' && } {state === 'lonely' && } {state === 'sleeping' && (
)}
); }