'use client'; import Link from 'next/link'; import { FileText, ClipboardSignature } from 'lucide-react'; import { usePaginatedQuery } from '@/hooks/use-paginated-query'; import { StatusPill, type StatusPillStatus } from '@/components/ui/status-pill'; interface HubRootDoc { id: string; title: string; documentType: string; status: string; createdAt: string; } interface HubRootFile { id: string; filename: string; createdAt: string; } interface Props { portSlug: string; } const STATUS_PILL_MAP: Record = { draft: 'draft', sent: 'sent', partially_signed: 'partial', completed: 'completed', signed: 'signed', expired: 'expired', cancelled: 'cancelled', rejected: 'rejected', }; export function HubRootView({ portSlug }: Props) { const { data: workflows, isLoading: workflowsLoading } = usePaginatedQuery({ queryKey: ['documents', 'hub-root', 'workflows'], endpoint: '/api/v1/documents?tab=in_progress', filterDefinitions: [], }); const { data: filesData, isLoading: filesLoading } = usePaginatedQuery({ queryKey: ['files', 'hub-root'], endpoint: '/api/v1/files?sort=createdAt&order=desc&limit=20', filterDefinitions: [], }); return (

Signing in progress

{workflowsLoading ? (
Loading...
) : workflows.length === 0 ? (
No workflows in flight.
) : (
    {workflows.map((w) => (
  • {w.title} {w.status.replace(/_/g, ' ')}
  • ))}
)}

Recent files

{filesLoading ? (
Loading...
) : filesData.length === 0 ? (
No files yet.
) : (
    {filesData.map((f) => (
  • {f.filename} {new Date(f.createdAt).toLocaleDateString('en-GB')}
  • ))}
)}
); }