diff --git a/frontend/src/pages/EngagementDetailPage.tsx b/frontend/src/pages/EngagementDetailPage.tsx index 47ca46c..f0ff78e 100644 --- a/frontend/src/pages/EngagementDetailPage.tsx +++ b/frontend/src/pages/EngagementDetailPage.tsx @@ -1,4 +1,4 @@ -import { useParams } from 'react-router-dom'; +import { useParams, Link } from 'react-router-dom'; import { extractApiError } from '@/api/client'; import { useAuth } from '@/hooks/useAuth'; import { useEngagement } from '@/hooks/useEngagements'; @@ -11,9 +11,8 @@ import { SimulationList } from '@/components/SimulationList'; import { ExportEngagementButton } from '@/components/ExportEngagementButton'; import { BackLink } from '@/components/BackLink'; import { Tabs } from '@/components/Tabs'; -import { Link } from 'react-router-dom'; -type TabId = 'schedule' | 'description' | 'simulations'; +type TabId = 'description' | 'simulations'; export function EngagementDetailPage(): JSX.Element { const { id } = useParams<{ id: string }>(); @@ -23,7 +22,7 @@ export function EngagementDetailPage(): JSX.Element { const detail = useEngagement(numericId); const simsQuery = useEngagementSimulations(numericId); - const [activeTabRaw, setActiveTab] = useHashTab('schedule'); + const [activeTabRaw, setActiveTab] = useHashTab('description'); const activeTab = activeTabRaw as TabId; if (detail.isLoading) return ; @@ -41,7 +40,6 @@ export function EngagementDetailPage(): JSX.Element { const simCount = simsQuery.data?.length; const tabs = [ - { id: 'schedule', label: 'Schedule' }, { id: 'description', label: 'Description' }, { id: 'simulations', label: 'Simulations', count: simCount }, ]; @@ -60,12 +58,7 @@ export function EngagementDetailPage(): JSX.Element { {canEditEngagements ? ( -
- - - Edit - -
+ ) : null} @@ -76,25 +69,27 @@ export function EngagementDetailPage(): JSX.Element { id={`tabpanel-${activeTab}`} aria-labelledby={`tab-${activeTab}`} > - {activeTab === 'schedule' && ( -
-

Schedule

-
-
Start date
-
{eng.start_date}
-
End date
-
{eng.end_date ?? '—'}
-
Status
-
{eng.status}
-
Created at
-
{eng.created_at}
-
-
- )} - {activeTab === 'description' && ( -
-

Description

+
+
+
+
Start date
+
{eng.start_date}
+
End date
+
{eng.end_date ?? '—'}
+
Status
+
+
Created at
+
{eng.created_at}
+
+ {canEditEngagements ? ( + + Edit + + ) : null} +
+
+

Description

{eng.description?.trim() ? eng.description : 'No description provided.'}