import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { EntityTimelineManager } from '@/components/timeline/EntityTimelineManager'; import { EntityVersionHistory } from '@/components/versioning/EntityVersionHistory'; import { FormerNamesSection } from './FormerNamesSection'; import { RideNameHistory } from '@/types/database'; import type { EntityType } from '@/types/timeline'; interface EntityHistoryTabsProps { entityType: EntityType; entityId: string; entityName: string; formerNames?: RideNameHistory[]; currentName?: string; } const getHistoryLabel = (entityType: string) => { switch (entityType) { case 'park': return 'Park History'; case 'ride': return 'Ride History'; case 'company': return 'Company History'; default: return 'History'; } }; const getHistoryValue = (entityType: string) => { switch (entityType) { case 'park': return 'park-history'; case 'ride': return 'ride-history'; case 'company': return 'company-history'; default: return 'entity-history'; } }; export function EntityHistoryTabs({ entityType, entityId, entityName, formerNames, currentName, }: EntityHistoryTabsProps) { const historyValue = getHistoryValue(entityType); const historyLabel = getHistoryLabel(entityType); return ( {historyLabel} Version History {formerNames && formerNames.length > 0 && currentName && ( )} {/* Dynamic Timeline Manager with Edit/Delete */} ); }