'use client'; import { useState } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { FileText, User, Target } from 'lucide-react'; import { IntakeTab } from './intake-tab'; import { ProfileTab } from './profile-tab'; import { PlanTab } from './plan-tab'; interface ClientTabsProps { clientId: string; activeTab?: string; } type TabId = 'intake' | 'profile' | 'plan'; const tabs = [ { id: 'intake' as TabId, label: 'Intake', icon: FileText, description: 'Intake gesprekken en notities', }, { id: 'profile' as TabId, label: 'Profiel', icon: User, description: 'Probleemprofielen en DSM categorieën', }, { id: 'plan' as TabId, label: 'Behandelplan', icon: Target, description: 'Behandeldoelen en interventies', }, ]; export function ClientTabs({ clientId, activeTab }: ClientTabsProps) { const router = useRouter(); const searchParams = useSearchParams(); const [currentTab, setCurrentTab] = useState( (activeTab as TabId) || 'intake' ); const handleTabChange = (tabId: TabId) => { setCurrentTab(tabId); const params = new URLSearchParams(searchParams.toString()); params.set('tab', tabId); router.push(`/epd/clients/${clientId}?${params.toString()}`); }; return (
{/* Tab Navigation */}
{tabs.map((tab) => { const Icon = tab.icon; const isActive = currentTab === tab.id; return ( ); })}
{/* Tab Content */}
{currentTab === 'intake' && } {currentTab === 'profile' && } {currentTab === 'plan' && }
); }