From bd4e7573188450fb793dbc342eb4af39ef6d54ed Mon Sep 17 00:00:00 2001 From: gibbyb Date: Wed, 24 Sep 2025 14:01:48 -0500 Subject: [PATCH] Revert back to old table as AI did a terrible job. --- .../components/layout/status/table/index.tsx | 314 +++++++----------- 1 file changed, 127 insertions(+), 187 deletions(-) diff --git a/apps/next/src/components/layout/status/table/index.tsx b/apps/next/src/components/layout/status/table/index.tsx index ddd64a0..287bfe7 100644 --- a/apps/next/src/components/layout/status/table/index.tsx +++ b/apps/next/src/components/layout/status/table/index.tsx @@ -74,46 +74,35 @@ export const StatusTable = ({ const containerCn = ccn({ context: tvMode, - className: 'mx-auto px-2 sm:px-4', + className: 'mx-auto', on: 'lg:w-11/12 w-full', - off: 'w-full max-w-7xl', + off: 'w-5/6', }); const headerCn = ccn({ context: tvMode, - className: 'w-full mb-4 flex justify-between', + className: 'w-full mb-2 flex justify-between', on: '', - off: 'mb-4', + off: 'mb-2', }); const thCn = ccn({ context: tvMode, - className: - 'py-3 px-2 sm:py-4 sm:px-4 border-b border-border font-semibold text-left', - on: 'text-4xl lg:text-6xl xl:min-w-[420px]', - off: 'text-sm sm:text-base md:text-lg lg:text-xl xl:min-w-[200px]', + className: 'py-4 px-4 border font-semibold ', + on: 'lg:text-6xl xl:min-w-[420px]', + off: 'lg:text-5xl xl:min-w-[320px]', }); const tdCn = ccn({ context: tvMode, - className: 'py-2 px-2 sm:py-3 sm:px-4 border-b border-border/50', - on: 'text-3xl lg:text-5xl', - off: 'text-xs sm:text-sm md:text-base', - }); - const tCheckboxCn = ccn({ - context: tvMode, - className: 'py-3 px-2 sm:px-4 border-b border-border text-center', - on: 'text-4xl', - off: 'text-sm', - }); - const checkBoxCn = ccn({ - context: tvMode, - className: 'cursor-pointer', - on: 'scale-150 lg:scale-200', - off: 'scale-100 sm:scale-125', + className: 'py-2 px-2 border', + on: 'lg:text-5xl', + off: 'lg:text-4xl', }); + const tCheckboxCn = `py-3 px-4 border`; + const checkBoxCn = `lg:scale-200 cursor-pointer`; return (
-
+
{!tvMode && (

Tired of the old table?

@@ -127,178 +116,120 @@ export const StatusTable = ({ )}
-
- - - - {!tvMode && ( - - )} - - + ); + })} + +
- - Technician - - - Status - - - + + + + {!tvMode && ( + - - - - - {statuses.map((status, i) => { - const { user: u, status: s } = status; - const isSelected = selectedUserIds.includes(u.id); - return ( - Technician + + + + + + {statuses.map((status, i) => { + const { user: u, status: s } = status; + const isSelected = selectedUserIds.includes(u.id); + return ( + - {!tvMode && ( - - )} - + )} + - - + + - - ); - })} - -
+ Updated At
+ + + Status + + + + Updated At
- handleSelectUser(u.id)} - /> - -
- -
-

- {u.name ?? 'Technician #' + (i + 1)} -

- {s?.updatedBy && s.updatedBy.id !== u.id && ( -
- - - Updated by {s.updatedBy.name} - -
- )} -
+ > + {!tvMode && ( +
+ handleSelectUser(u.id)} + /> + +
+ +
+

{u.name ?? 'Technician #' + (i + 1)}

+ {s?.updatedBy && s.updatedBy.id !== u.id && ( +
+ + + Updated by {s.updatedBy.name} + +
+ )}
-
- - - - {s?.message ?? 'No status'} - - - - - - - -
-
+
+
+ + {s?.message} + + + + + +
+
+
- {s ? formatTime(s.updatedAt) : '--:--'} - +

-
+
- - {s ? formatDate(s.updatedAt) : '--/--/--'} - + {s ? formatDate(s.updatedAt) : '--:--'} +

- - - -
- + + + + + +
{statuses.length === 0 && (

)} {!tvMode && ( -

+
setStatusInput(e.target.value)} @@ -326,13 +261,18 @@ export const StatusTable = ({ }} /> {selectedUserIds.length > 0 - ? `Update ${selectedUserIds.length} ${selectedUserIds.length > 1 ? 'users' : 'user'}` + ? `Update status for ${selectedUserIds.length} + ${selectedUserIds.length > 1 ? 'users' : 'user'}` : 'Update status'}