mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 15:51:12 -05:00
Refactor History component
This commit is contained in:
@@ -16,9 +16,7 @@ import { useUserRole } from '@/hooks/useUserRole';
|
||||
import { toast } from '@/hooks/use-toast';
|
||||
import { submitCompanyUpdate } from '@/lib/companyHelpers';
|
||||
import { VersionIndicator } from '@/components/versioning/VersionIndicator';
|
||||
import { EntityVersionHistory } from '@/components/versioning/EntityVersionHistory';
|
||||
import { EntityHistoryTimeline, HistoryEvent } from '@/components/history/EntityHistoryTimeline';
|
||||
import { FormerNamesSection } from '@/components/history/FormerNamesSection';
|
||||
import { EntityHistoryTabs } from '@/components/history/EntityHistoryTabs';
|
||||
|
||||
export default function DesignerDetail() {
|
||||
const { slug } = useParams<{ slug: string }>();
|
||||
@@ -276,34 +274,19 @@ export default function DesignerDetail() {
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="history" className="mt-6">
|
||||
<Tabs defaultValue="company-history" className="w-full">
|
||||
<TabsList className="w-full max-w-md">
|
||||
<TabsTrigger value="company-history">Company History</TabsTrigger>
|
||||
<TabsTrigger value="version-history">Version History</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="company-history" className="mt-6 space-y-6">
|
||||
<EntityHistoryTimeline
|
||||
events={[
|
||||
...(designer.founded_year ? [{
|
||||
date: `${designer.founded_year}`,
|
||||
title: `${designer.name} Founded`,
|
||||
description: `${designer.name} was established`,
|
||||
type: 'milestone' as const
|
||||
}] : []),
|
||||
]}
|
||||
entityName={designer.name}
|
||||
/>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="version-history" className="mt-6">
|
||||
<EntityVersionHistory
|
||||
entityType="company"
|
||||
entityId={designer.id}
|
||||
entityName={designer.name}
|
||||
/>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
<EntityHistoryTabs
|
||||
entityType="company"
|
||||
entityId={designer.id}
|
||||
entityName={designer.name}
|
||||
events={[
|
||||
...(designer.founded_year ? [{
|
||||
date: `${designer.founded_year}`,
|
||||
title: `${designer.name} Founded`,
|
||||
description: `${designer.name} was established`,
|
||||
type: 'milestone' as const
|
||||
}] : []),
|
||||
]}
|
||||
/>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user