'use client'; import { useState } from 'react'; import Link from 'next/link'; import { useParams } from 'next/navigation'; import { Plus } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Table, TableHeader, TableBody, TableCell, TableHead, TableRow, } from '@/components/ui/table'; import { EmptyState } from '@/components/shared/empty-state'; import { PermissionGate } from '@/components/shared/permission-gate'; import { YachtForm } from '@/components/yachts/yacht-form'; interface ClientYachtsTabProps { clientId: string; yachts: Array<{ id: string; name: string; hullNumber: string | null; registration: string | null; lengthFt: string | null; widthFt: string | null; status: string; }>; } export function ClientYachtsTab({ clientId: _clientId, yachts }: ClientYachtsTabProps) { const routeParams = useParams<{ portSlug: string }>(); const portSlug = routeParams?.portSlug ?? ''; const [createOpen, setCreateOpen] = useState(false); return (

Client-owned yachts

{yachts.length === 0 ? ( ) : (
Name Dimensions Hull Number Status {yachts.map((y) => ( {y.name} {y.lengthFt && y.widthFt ? `${y.lengthFt} × ${y.widthFt} ft` : '—'} {y.hullNumber ?? '—'} {y.status.replace('_', ' ')} ))}
)} {/* TODO: YachtForm (Task 5.2) does not yet accept a preset owner prop. When opened here, the user must manually pick this client in the owner picker. Wire an `initialOwner` prop into YachtForm in a follow-up so we can pre-select `{ type: 'client', id: clientId }`. */} {createOpen && }
); }