'use client'; import type { DetailTab } from '@/components/shared/detail-layout'; import { EmptyState } from '@/components/shared/empty-state'; import { YachtOwnershipHistory } from '@/components/yachts/yacht-ownership-history'; interface YachtTabsYacht { id: string; name: string; hullNumber: string | null; registration: string | null; flag: string | null; yearBuilt: number | null; builder: string | null; model: string | null; hullMaterial: string | null; lengthFt: string | null; widthFt: string | null; draftFt: string | null; lengthM: string | null; widthM: string | null; draftM: string | null; status: string; notes: string | null; } interface YachtTabsOptions { yachtId: string; currentUserId?: string; yacht: YachtTabsYacht; } function InfoRow({ label, value }: { label: string; value?: string | number | null }) { if (value === null || value === undefined || value === '') return null; return (
{label}
{value}
); } const STATUS_LABELS: Record = { active: 'Active', retired: 'Retired', sold_away: 'Sold away', }; function OverviewTab({ yacht }: { yacht: YachtTabsYacht }) { const hasFtDimensions = yacht.lengthFt || yacht.widthFt || yacht.draftFt; const hasMDimensions = yacht.lengthM || yacht.widthM || yacht.draftM; return (
{/* Identity */}

Identity

{/* Build */} {(yacht.builder || yacht.model || yacht.hullMaterial) && (

Build

)} {/* Dimensions (ft) */} {hasFtDimensions && (

Dimensions (ft)

)} {/* Dimensions (m) */} {hasMDimensions && (

Dimensions (m)

)} {/* Notes */} {yacht.notes && (

Notes

{yacht.notes}

)}
); } export function getYachtTabs({ yachtId, // currentUserId reserved for when NotesList supports entityType='yachts'. currentUserId: _currentUserId, yacht, }: YachtTabsOptions): DetailTab[] { void _currentUserId; return [ { id: 'overview', label: 'Overview', content: , }, { id: 'ownership-history', label: 'Ownership History', content: , }, { id: 'interests', label: 'Interests', content: , }, { id: 'reservations', label: 'Reservations', content: , }, { id: 'notes', label: 'Notes', // TODO: NotesList currently supports entityType 'clients' | 'interests'. // Extend NotesList (or swap to a yacht-notes endpoint) in a follow-up. content: ( ), }, { id: 'tags', label: 'Tags', // TODO: replace with an inline tag editor once one exists; yacht tags // can be edited via the Edit form in the meantime. content: ( ), }, ]; }