From 2155291551d6bad1b24d94eaaa8b9fe6e87bb65f Mon Sep 17 00:00:00 2001 From: kraysent Date: Sun, 31 May 2026 17:42:00 +0100 Subject: [PATCH] Show crossmatch button again --- src/pages/TableDetails.tsx | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/pages/TableDetails.tsx b/src/pages/TableDetails.tsx index 8c9f8fa..699483d 100644 --- a/src/pages/TableDetails.tsx +++ b/src/pages/TableDetails.tsx @@ -383,28 +383,28 @@ function catalogProgressTabClassName(isActive: boolean): string { ); } +function hasCrossmatchWork(progress: TableProgress): boolean { + return ( + progress.unprocessed > 0 || + progress.pending_triage > 0 || + progress.resolved_unsubmitted > 0 + ); +} + function TableProgressSummaryCard({ progress, tableName, - hasCrossmatch, - navigate, className, }: { progress: TableProgress; tableName: string; - hasCrossmatch: boolean; - navigate: (path: string) => void; className?: string; }): ReactElement { - const actions: CardAction[] = hasCrossmatch + const actions: CardAction[] = hasCrossmatchWork(progress) ? [ { title: "View crossmatch results", - onClick: () => { - navigate( - `/crossmatch?table_name=${encodeURIComponent(tableName)}&triage_status=pending`, - ); - }, + href: `/crossmatch?table_name=${encodeURIComponent(tableName)}&triage_status=pending`, }, ] : []; @@ -586,7 +586,6 @@ async function fetcher( export function TableDetailsPage(): ReactElement { const { tableName } = useParams<{ tableName: string }>(); - const navigate = useNavigate(); const [refreshKey, setRefreshKey] = useState(0); const { @@ -611,8 +610,6 @@ export function TableDetailsPage(): ReactElement { 0 ? "lg:col-span-3"