'use client'; import type { DetailTab } from '@/components/shared/detail-layout'; import { NotesList } from '@/components/shared/notes-list'; import { ClientYachtsTab } from '@/components/clients/client-yachts-tab'; import { ClientCompaniesTab } from '@/components/clients/client-companies-tab'; import { ClientReservationsTab } from '@/components/clients/client-reservations-tab'; interface ClientTabsOptions { clientId: string; currentUserId?: string; client: { fullName: string; nationality?: string | null; preferredContactMethod?: string | null; preferredLanguage?: string | null; timezone?: string | null; source?: string | null; sourceDetails?: string | null; contacts?: Array<{ id: string; channel: string; value: string; label?: string | null; isPrimary: boolean; }>; yachts: Array<{ id: string; name: string; hullNumber: string | null; registration: string | null; lengthFt: string | null; widthFt: string | null; status: string; }>; companies: Array<{ membershipId: string; role: string; isPrimary: boolean; startDate: string | Date; company: { id: string; name: string; legalName: string | null; status: string; }; }>; activeReservations: Array<{ id: string; berthId: string; yachtId: string; startDate: string | Date; tenureType: string; status: string; }>; tags?: Array<{ id: string; name: string; color: string }>; }; } function InfoRow({ label, value }: { label: string; value?: string | null }) { if (!value) return null; return (
{label}
{value}
); } function OverviewTab({ client }: { client: ClientTabsOptions['client'] }) { return (
{/* Personal Info */}

Personal Information

{/* Contacts */}

Contact Details

{client.contacts && client.contacts.length > 0 ? (
{client.contacts.map((c) => (
{c.channel} {c.value} {c.label && ( {c.label} )} {c.isPrimary && Primary}
))}
) : (

No contacts added

)}
{/* Source */} {(client.source || client.sourceDetails) && (

Source

)} {/* Tags */} {client.tags && client.tags.length > 0 && (

Tags

{client.tags.map((tag) => ( {tag.name} ))}
)}
); } export function getClientTabs({ clientId, currentUserId, client }: ClientTabsOptions): DetailTab[] { return [ { id: 'overview', label: 'Overview', content: , }, { id: 'yachts', label: 'Yachts', badge: client.yachts.length, content: , }, { id: 'companies', label: 'Companies', badge: client.companies.length, content: , }, { id: 'reservations', label: 'Reservations', badge: client.activeReservations.length, content: ( ), }, { id: 'interests', label: 'Interests', content: (

Interests will appear here once created.

), }, { id: 'notes', label: 'Notes', content: , }, { id: 'files', label: 'Files', content: (

File attachments coming soon.

), }, { id: 'activity', label: 'Activity', content: (

Activity log coming soon.

), }, ]; }