diff --git a/src/components/layout/status/table/index.tsx b/src/components/layout/status/table/index.tsx index 5517d71..36242e3 100644 --- a/src/components/layout/status/table/index.tsx +++ b/src/components/layout/status/table/index.tsx @@ -40,7 +40,7 @@ export const StatusTable = ({ const bulkCreate = useMutation(api.statuses.bulkCreate); - const handleSelectUser = (id: Id<'users'>, e: React.MouseEvent) => { + const handleSelectUser = (id: Id<'users'>) => { setSelectedUserIds((prev) => prev.some((i) => i === id) ? prev.filter((prevId) => prevId !== id) @@ -127,7 +127,7 @@ export const StatusTable = ({ type='checkbox' className={checkBoxCn} checked={selectAll} - onChange={() => handleSelectAll()} + onChange={handleSelectAll} /> )} @@ -143,7 +143,67 @@ export const StatusTable = ({ Updated At - + + {statuses.map((status, i) => { + const { user: u, status: s } = status; + const isSelected = selectedUserIds.includes(u.id); + return ( + + {!tvMode && ( + + handleSelectUser(u.id)} + /> + + )} + +
+ +
+

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

+ {s?.updatedBy && s.updatedBy.id !== u.id && ( +
+ + + Updated by {s.updatedBy.name} + +
+ )} +
+
+ + + + + + + + + + + ); + })} + );