diff --git a/src/components/documents/documents-hub.tsx b/src/components/documents/documents-hub.tsx index f25adeb0..85cbe49f 100644 --- a/src/components/documents/documents-hub.tsx +++ b/src/components/documents/documents-hub.tsx @@ -14,7 +14,6 @@ import { PermissionGate } from '@/components/shared/permission-gate'; import { usePaginatedQuery } from '@/hooks/use-paginated-query'; import { useRealtimeInvalidation } from '@/hooks/use-realtime-invalidation'; import { useDocumentFolders, type FolderNode } from '@/hooks/use-document-folders'; -import type { DocumentsHubTab } from '@/lib/validators/documents'; import { FolderActionsMenu } from './folder-actions-menu'; import { FolderBreadcrumb } from './folder-breadcrumb'; import { FolderTreeSidebar } from './folder-tree-sidebar'; @@ -64,7 +63,6 @@ const SIGNER_STATUS_LABELS: Record = { interface DocumentsHubProps { portSlug: string; - initialTab?: DocumentsHubTab; } function findInTree(nodes: FolderNode[], id: string): FolderNode | null { @@ -137,7 +135,7 @@ export function DocumentsHub({ portSlug }: DocumentsHubProps) { entityId={selectedFolder!.entityId!} /> ) : ( - + )} diff --git a/src/components/documents/entity-folder-view.tsx b/src/components/documents/entity-folder-view.tsx index 9c1ab004..cfc716f8 100644 --- a/src/components/documents/entity-folder-view.tsx +++ b/src/components/documents/entity-folder-view.tsx @@ -8,7 +8,11 @@ import { AggregatedSection } from './aggregated-section'; import { SigningDetailsDialog } from './signing-details-dialog'; import { useAggregatedFiles, useAggregatedWorkflows } from '@/hooks/use-aggregated-listing'; import { StatusPill, type StatusPillStatus } from '@/components/ui/status-pill'; -import type { AggregatedWorkflow, AggregatedFile, AggregatedGroup } from '@/hooks/use-aggregated-listing'; +import type { + AggregatedWorkflow, + AggregatedFile, + AggregatedGroup, +} from '@/hooks/use-aggregated-listing'; interface Props { portSlug: string; @@ -68,19 +72,17 @@ export function EntityFolderView({ portSlug, entityType, entityId }: Props) { loading={filesLoading} emptyMessage="No files for this entity yet." renderRow={(f: AggregatedFile, _group: AggregatedGroup) => { - // Heuristic v1: auto-deposit handler (Task 7) names signed files with "signed-" prefix. - // Follow-up: surface signedFromDocumentId from the aggregated API for a principled check. - const isSigned = f.filename?.startsWith('signed-'); + const signedFromDocumentId = f.signedFromDocumentId; return (
{f.filename}
{new Date(f.createdAt).toLocaleDateString('en-GB')} - {isSigned ? ( + {signedFromDocumentId ? (