'use client'; import { useEffect, useState } from 'react'; import { Plus } from 'lucide-react'; import Link from 'next/link'; import { getIntakesByClientId, Intake } from '../intakes/actions'; import { IntakeList } from '../intakes/components/intake-list'; interface IntakeTabProps { clientId: string; } export function IntakeTab({ clientId }: IntakeTabProps) { const [intakes, setIntakes] = useState([]); const [isLoading, setIsLoading] = useState(true); useEffect(() => { async function fetchIntakes() { try { const data = await getIntakesByClientId(clientId); setIntakes(data); } catch (error) { console.error('Failed to fetch intakes:', error); } finally { setIsLoading(false); } } fetchIntakes(); }, [clientId]); return (
{/* Header */}

Intakes

Overzicht van alle intakes

Nieuwe Intake
); }