From bb83acbe81ff2873022cb80964463583a336e691 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Tue, 3 Feb 2026 11:11:28 +0700 Subject: [PATCH] refactor(FE): Render previews for multiple uniformities --- .../production/uniformity/UniformityTable.tsx | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/src/components/pages/production/uniformity/UniformityTable.tsx b/src/components/pages/production/uniformity/UniformityTable.tsx index a3530032..9bb79fa9 100644 --- a/src/components/pages/production/uniformity/UniformityTable.tsx +++ b/src/components/pages/production/uniformity/UniformityTable.tsx @@ -1129,15 +1129,12 @@ const UniformityTable = () => { }} >
- {selectedRowIds.length === 1 ? ( + {selectedUniformities.map((uniformity) => ( - ) : ( -
- {selectedRowIds.length} data dipilih -
- )} + ))}
@@ -1146,7 +1143,11 @@ const UniformityTable = () => { type='success' iconPosition='left' text={`Approve This Submission?`} - subtitleText={`Are you sure you want to approve this submission? (${selectedRowIds.length} data)`} + subtitleText={ + selectedRowIds.length === 1 + ? 'Are you sure you want to approve this submission?' + : `Are you sure you want to approve these submissions? (${selectedRowIds.length} data)` + } secondaryButton={{ text: 'Cancel', }} @@ -1161,7 +1162,12 @@ const UniformityTable = () => { }} >
- + {selectedUniformities.map((uniformity) => ( + + ))}
@@ -1185,15 +1191,12 @@ const UniformityTable = () => { }} >
- {selectedRowIds.length === 1 ? ( + {selectedUniformities.map((uniformity) => ( - ) : ( -
- {selectedRowIds.length} data dipilih -
- )} + ))}
@@ -1202,7 +1205,11 @@ const UniformityTable = () => { type='error' iconPosition='left' text={`Reject This Submission?`} - subtitleText={`Are you sure you want to reject this submission? (${selectedRowIds.length} data)`} + subtitleText={ + selectedRowIds.length === 1 + ? 'Are you sure you want to reject this submission?' + : `Are you sure you want to reject these submissions? (${selectedRowIds.length} data)` + } secondaryButton={{ text: 'Cancel', }} @@ -1217,15 +1224,12 @@ const UniformityTable = () => { }} >
- {selectedRowIds.length === 1 ? ( + {selectedUniformities.map((uniformity) => ( - ) : ( -
- {selectedRowIds.length} data dipilih -
- )} + ))}