refactor(FE): Update table columns and improve UI for Project Flock

pages
This commit is contained in:
rstubryan
2026-02-18 11:52:30 +07:00
parent 512ccddfc7
commit 9d6cc90162
2 changed files with 49 additions and 19 deletions
@@ -191,13 +191,6 @@ const ProjectFlockClosingForm = ({
isResponseSuccess(closingData) ? closingData.data?.expenses : []
}
columns={[
{
header: 'PO Number',
accessorKey: 'po_number',
cell(props) {
return props.row.original.po_number || '-';
},
},
{
header: 'Ref Number',
accessorKey: 'reference_number',
@@ -205,9 +198,19 @@ const ProjectFlockClosingForm = ({
return props.row.original.reference_number || '-';
},
},
{
header: 'PO Number',
accessorKey: 'po_number',
cell(props) {
return props.row.original.po_number || '-';
},
},
{
header: 'Total',
accessorKey: 'total',
cell(props) {
return formatNumber(props.row.original.total);
},
},
{
header: 'Status',
@@ -276,6 +279,9 @@ const ProjectFlockClosingForm = ({
{
header: 'Quantity',
accessorKey: 'quantity',
cell(props) {
return formatNumber(props.row.original.quantity);
},
},
{
header: 'UOM',
@@ -226,15 +226,37 @@ const ProjectFlockDetail = ({
<div className='w-full p-4 flex flex-col gap-3 border-b border-base-content/10'>
<h4 className='text-base font-medium text-base-content/50 font-roboto'>
Kandang Aktif
Kandang
</h4>
<div className='flex flex-row gap-2'>
<StatusBadge
color='info'
text={`Kandang Aktif (${projectFlock.kandangs?.length})`}
className={{ badge: 'w-fit text-nowrap' }}
/>
<div className='flex flex-row flex-wrap gap-2 overflow-hidden'>
{projectFlock.kandangs?.filter(
(kandang) => kandang.status !== 'NON_ACTIVE'
).length > 0 && (
<StatusBadge
color='success'
text={`Kandang Aktif (${
projectFlock.kandangs?.filter(
(kandang) => kandang.status !== 'NON_ACTIVE'
).length ?? 0
})`}
className={{ badge: 'w-fit' }}
/>
)}
{projectFlock.kandangs?.filter(
(kandang) => kandang.status === 'NON_ACTIVE'
).length > 0 && (
<StatusBadge
color='error'
text={`Kandang Non-Aktif (${
projectFlock.kandangs?.filter(
(kandang) => kandang.status === 'NON_ACTIVE'
).length ?? 0
})`}
className={{ badge: 'w-fit' }}
/>
)}
<StatusBadge
color='neutral'
@@ -256,7 +278,7 @@ const ProjectFlockDetail = ({
/>
</>
}
className={{ badge: 'w-fit text-nowrap cursor-pointer' }}
className={{ badge: 'w-fit cursor-pointer' }}
/>
</div>
@@ -368,10 +390,12 @@ const ProjectFlockDetail = ({
</RadioGroup>
</Card>
<ApprovalStepsV2
approvals={projectFlockKandangApproval}
steps={APPROVAL_WORKFLOWS.PROJECT_FLOCK_KANDANGS}
/>
<div className='-mx-4'>
<ApprovalStepsV2
approvals={projectFlockKandangApproval}
steps={APPROVAL_WORKFLOWS.PROJECT_FLOCK_KANDANGS}
/>
</div>
<div className='grid grid-cols-4 gap-3'>
<RequirePermission permissions='lti.production.chickins.detail'>