'use client'; import { useCallback, useEffect, useRef } from 'react'; import { configStore, useConfigStore } from '@/store/useConfigStore'; import { personaStore, usePersonaStore } from '@/store/usePersonaStore'; import { PricingEngine } from './PricingEngine'; export function ConfigPanel() { const activeColors = useConfigStore((s) => s.activeColors); const activePersona = useConfigStore((s) => s.activePersonaAttire); const personas = usePersonaStore((s) => s.personas); const colorsSectionRef = useRef(null); const personaSectionRef = useRef(null); useEffect(() => { personaStore.getState().hydrate(); }, []); const handleColorChange = useCallback((key: 'primary' | 'secondary' | 'accent', value: string) => { configStore.getState().setColors({ [key]: value }); }, []); const handlePersonaSelect = useCallback((attire: string) => { configStore.getState().setPersonaAttire(attire); }, []); const handleReset = useCallback(() => { configStore.getState().reset(); configStore.getState().setHydrated(true); }, []); return (
{/* --- COLORS SECTION --- */}

Colors

handleColorChange('primary', v)} />
{/* --- PERSONA SECTION --- */}

Persona Attire

{personas.map((persona) => { const isActive = activePersona === persona.id; return ( ); })}
{/* --- PRICING --- */} {/* --- RESET --- */}
); } function ColorInput({ label, value, onChange }: { label: string; value: string; onChange: (v: string) => void }) { return (
onChange(e.target.value)} style={{ width: '32px', height: '32px', border: '2px solid rgba(0, 0, 0, 0.08)', borderRadius: '0.375rem', background: 'transparent', cursor: 'pointer', padding: 0, }} aria-label={`${label} color`} />
{label}
{value}
); } const sectionTitleStyle: React.CSSProperties = { fontSize: '0.75rem', fontWeight: 500, color: '#94a3b8', textTransform: 'uppercase', letterSpacing: '0.05em', margin: 0, paddingBottom: '0.5rem', borderBottom: '1px solid rgba(0, 0, 0, 0.06)', marginBottom: '0.75rem', };