'use client'; import { type DetailTab } from '@/components/shared/detail-layout'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { TagBadge } from '@/components/shared/tag-badge'; import { BerthReservationsTab } from './berth-reservations-tab'; type BerthData = { id: string; mooringNumber: string; area: string | null; status: string; lengthFt: string | null; lengthM: string | null; widthFt: string | null; widthM: string | null; draftFt: string | null; draftM: string | null; widthIsMinimum: boolean | null; nominalBoatSize: string | null; nominalBoatSizeM: string | null; waterDepth: string | null; waterDepthM: string | null; waterDepthIsMinimum: boolean | null; sidePontoon: string | null; powerCapacity: string | null; voltage: string | null; mooringType: string | null; cleatType: string | null; cleatCapacity: string | null; bollardType: string | null; bollardCapacity: string | null; access: string | null; price: string | null; priceCurrency: string; bowFacing: string | null; berthApproved: boolean | null; tenureType: string; tenureYears: number | null; tenureStartDate: string | null; tenureEndDate: string | null; statusLastChangedReason: string | null; statusLastModified: string | null; tags: Array<{ id: string; name: string; color: string }>; }; function SpecRow({ label, value }: { label: string; value: React.ReactNode }) { if (!value && value !== 0 && value !== false) return null; return (
{label} {value}
); } function OverviewTab({ berth }: { berth: BerthData }) { const formatDim = (ft: string | null, m: string | null) => { const parts = []; if (ft) parts.push(`${ft} ft`); if (m) parts.push(`${m} m`); return parts.length > 0 ? parts.join(' / ') : null; }; const price = berth.price ? new Intl.NumberFormat('en-US', { style: 'currency', currency: berth.priceCurrency || 'USD', maximumFractionDigits: 0, }).format(Number(berth.price)) : null; return (
{/* Specifications */} Specifications {/* Infrastructure & Pricing */}
Infrastructure Tenure & Pricing {berth.tenureType === 'fixed_term' && ( <> )} {berth.tags.length > 0 && ( Tags
{berth.tags.map((tag) => ( ))}
)}
); } function StubTab({ label }: { label: string }) { return (

{label} coming soon

); } export function buildBerthTabs(berth: BerthData): DetailTab[] { return [ { id: 'overview', label: 'Overview', content: , }, { id: 'interests', label: 'Interests', content: , }, { id: 'reservations', label: 'Reservations', content: , }, { id: 'waiting-list', label: 'Waiting List', content: , }, { id: 'maintenance', label: 'Maintenance Log', content: , }, { id: 'activity', label: 'Activity', content: , }, ]; }