refactor(FE-438): Localize modal buttons and stub uniformity details

This commit is contained in:
rstubryan
2025-12-28 18:48:00 +07:00
parent 2d0c8dbd3f
commit 9f0dc8c644
@@ -541,10 +541,10 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
text={`Delete This Data?`}
subtitleText='Are you sure you want to delete this data?'
secondaryButton={{
text: 'Tidak',
text: 'Cancel',
}}
primaryButton={{
text: 'Ya',
text: 'Delete',
color: 'primary',
isLoading: isDeleteLoading,
onClick: singleDeleteHandler,
@@ -615,10 +615,10 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
text={`Delete This Data?`}
subtitleText={`Are you sure you want to delete this data? (${selectedRowIds.length} data)`}
secondaryButton={{
text: 'Tidak',
text: 'Cancel',
}}
primaryButton={{
text: 'Ya',
text: 'Delete',
color: 'primary',
isLoading: isBulkActionLoading,
onClick: bulkDeleteHandler,
@@ -689,10 +689,10 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
text='Approve This Submission?'
subtitleText='Are you sure you want to approve this submission?'
secondaryButton={{
text: 'Tidak',
text: 'Cancel',
}}
primaryButton={{
text: 'Ya',
text: 'Approve',
color: 'primary',
isLoading: isDeleteLoading,
onClick: singleApproveHandler,
@@ -707,34 +707,32 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
{
id: 'tanggal',
label: 'Tanggal',
value: selectedUniformity
? formatDate(selectedUniformity.applied_at, 'DD MMM YYYY')
: '-',
value: '28 Desember 2025',
},
{
id: 'lokasi-farm',
label: 'Lokasi Farm',
value: selectedUniformity?.location_name || '-',
value: 'Farm A',
},
{
id: 'project-flock',
label: 'Project Flock',
value: selectedUniformity?.flock_name || '-',
value: 'Flock 2025-01',
},
{
id: 'kandang',
label: 'Kandang',
value: selectedUniformity?.kandang_name || '-',
value: 'Kandang 1',
},
{
id: 'uniformity',
label: 'Uniformity',
value: `${selectedUniformity?.uniformity || 0}%`,
id: 'file-uniformity',
label: 'File Uniformity',
value: 'uniformity_data.xlsx',
},
{
id: 'status',
label: 'Status',
value: getStatusText(selectedUniformity?.status || 'CREATED'),
value: 'Disetujui',
},
]}
columns={[
@@ -765,10 +763,10 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
text={`Approve This Submission?`}
subtitleText={`Are you sure you want to approve this submission? (${selectedRowIds.length} data)`}
secondaryButton={{
text: 'Tidak',
text: 'Cancel',
}}
primaryButton={{
text: 'Ya',
text: 'Approve',
color: 'primary',
isLoading: isBulkActionLoading,
onClick: bulkApproveHandler,
@@ -779,11 +777,38 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
>
<div className='flex flex-col gap-4 mt-4'>
<Table
data={selectedUniformities.map((u, index) => ({
id: `bulk-approve-${index}`,
label: `${index + 1}. ${u.location_name}`,
value: `${u.flock_name} - ${u.kandang_name}`,
}))}
data={[
{
id: 'tanggal',
label: 'Tanggal',
value: '28 Desember 2025',
},
{
id: 'lokasi-farm',
label: 'Lokasi Farm',
value: 'Farm A',
},
{
id: 'project-flock',
label: 'Project Flock',
value: 'Flock 2025-01',
},
{
id: 'kandang',
label: 'Kandang',
value: 'Kandang 1',
},
{
id: 'file-uniformity',
label: 'File Uniformity',
value: 'uniformity_data.xlsx',
},
{
id: 'status',
label: 'Status',
value: 'Disetujui',
},
]}
columns={[
{
accessorKey: 'label',
@@ -796,7 +821,7 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
cell: (props) => <span>{props.row.original.value}</span>,
},
]}
pageSize={selectedUniformities.length}
pageSize={6}
className={{
containerClassName: 'mb-0',
paginationClassName: 'hidden',
@@ -812,10 +837,10 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
text='Reject This Submission?'
subtitleText='Are you sure you want to reject this submission?'
secondaryButton={{
text: 'Tidak',
text: 'Cancel',
}}
primaryButton={{
text: 'Ya',
text: 'Reject',
color: 'primary',
isLoading: isDeleteLoading,
onClick: singleRejectHandler,
@@ -830,34 +855,32 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
{
id: 'tanggal',
label: 'Tanggal',
value: selectedUniformity
? formatDate(selectedUniformity.applied_at, 'DD MMM YYYY')
: '-',
value: '28 Desember 2025',
},
{
id: 'lokasi-farm',
label: 'Lokasi Farm',
value: selectedUniformity?.location_name || '-',
value: 'Farm A',
},
{
id: 'project-flock',
label: 'Project Flock',
value: selectedUniformity?.flock_name || '-',
value: 'Flock 2025-01',
},
{
id: 'kandang',
label: 'Kandang',
value: selectedUniformity?.kandang_name || '-',
value: 'Kandang 1',
},
{
id: 'uniformity',
label: 'Uniformity',
value: `${selectedUniformity?.uniformity || 0}%`,
id: 'file-uniformity',
label: 'File Uniformity',
value: 'uniformity_data.xlsx',
},
{
id: 'status',
label: 'Status',
value: getStatusText(selectedUniformity?.status || 'CREATED'),
value: 'Disetujui',
},
]}
columns={[
@@ -887,11 +910,11 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
iconPosition='left'
text={`Apakah anda yakin ingin menolak ${selectedRowIds.length} data Uniformity yang dipilih?`}
secondaryButton={{
text: 'Tidak',
text: 'Cancel',
}}
primaryButton={{
text: 'Ya',
color: 'error',
text: 'Reject',
color: 'primary',
isLoading: isBulkActionLoading,
onClick: bulkRejectHandler,
}}
@@ -901,11 +924,38 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
>
<div className='flex flex-col gap-4 mt-4'>
<Table
data={selectedUniformities.map((u, index) => ({
id: `bulk-reject-${index}`,
label: `${index + 1}. ${u.location_name}`,
value: `${u.flock_name} - ${u.kandang_name}`,
}))}
data={[
{
id: 'tanggal',
label: 'Tanggal',
value: '28 Desember 2025',
},
{
id: 'lokasi-farm',
label: 'Lokasi Farm',
value: 'Farm A',
},
{
id: 'project-flock',
label: 'Project Flock',
value: 'Flock 2025-01',
},
{
id: 'kandang',
label: 'Kandang',
value: 'Kandang 1',
},
{
id: 'file-uniformity',
label: 'File Uniformity',
value: 'uniformity_data.xlsx',
},
{
id: 'status',
label: 'Status',
value: 'Disetujui',
},
]}
columns={[
{
accessorKey: 'label',
@@ -918,7 +968,7 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
cell: (props) => <span>{props.row.original.value}</span>,
},
]}
pageSize={selectedUniformities.length}
pageSize={6}
className={{
containerClassName: 'mb-0',
paginationClassName: 'hidden',