From 8ab56d9782d5d0fe347a6e5cbf132e96c7bb1f95 Mon Sep 17 00:00:00 2001 From: Arthur Bassi Date: Wed, 19 Aug 2026 14:48:04 -0300 Subject: [PATCH] refactor(work-orders): extract WoTable loading and empty shells Keep the list table under the changed-file function length gate. --- .../_components/list/table/wo-table.tsx | 59 ++++++++++++------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/src/app/(protected)/workorders/_components/list/table/wo-table.tsx b/src/app/(protected)/workorders/_components/list/table/wo-table.tsx index 3a45d5ac..7e45824c 100644 --- a/src/app/(protected)/workorders/_components/list/table/wo-table.tsx +++ b/src/app/(protected)/workorders/_components/list/table/wo-table.tsx @@ -40,6 +40,34 @@ type WoTableProps = { onPatch: (id: string | number, patch: WorkOrderTablePatch) => void; }; +type WoTableEmptyShellProps = { + message: string; + actionLabel: string; + onAction?: () => void; +}; + +function WoTableLoading({ + weekMonday, + selectedDayIso, +}: { + weekMonday: string; + selectedDayIso?: string; +}) { + return ( + + + + ); +} + +function WoTableEmptyShell({ message, actionLabel, onAction }: WoTableEmptyShellProps) { + return ( + + + + ); +} + export function WoTable({ tableData, users, @@ -125,12 +153,7 @@ export function WoTable({ if (tableData.isLoading) { return ( - - - + ); } @@ -138,25 +161,21 @@ export function WoTable({ if (emptyAdv) { return ( - - - + ); } if (!tableData.advActive && tableData.noSearchResults) { return ( - - - + ); }