feat(FE-316,317): Add accessorKey and id for UniformityTable columns

This commit is contained in:
rstubryan
2025-12-23 22:15:33 +07:00
parent 035f187bac
commit 9e5d878e82
@@ -229,22 +229,27 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
}, },
}, },
{ {
accessorKey: 'location.name',
header: 'Lokasi', header: 'Lokasi',
cell: (props) => props.row.original.location.name || '-', cell: (props) => props.row.original.location.name || '-',
}, },
{ {
accessorKey: 'project_flock_kandang_id',
header: 'Flock', header: 'Flock',
cell: (props) => `Flock ${props.row.original.project_flock_kandang_id}`, cell: (props) => `Flock ${props.row.original.project_flock_kandang_id}`,
}, },
{ {
accessorKey: 'kandang.name',
header: 'Kandang', header: 'Kandang',
cell: (props) => props.row.original.kandang.name || '-', cell: (props) => props.row.original.kandang.name || '-',
}, },
{ {
accessorKey: 'week',
header: 'Tanggal (Week)', header: 'Tanggal (Week)',
cell: (props) => `Week ${props.row.original.week}`, cell: (props) => `Week ${props.row.original.week}`,
}, },
{ {
accessorKey: 'status',
header: 'Status', header: 'Status',
cell: (props) => { cell: (props) => {
const status = props.row.original.status; const status = props.row.original.status;
@@ -256,6 +261,7 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
}, },
}, },
{ {
accessorKey: 'uniformity',
header: 'Uniformity', header: 'Uniformity',
cell: (props) => { cell: (props) => {
const uniformity = props.row.original.uniformity; const uniformity = props.row.original.uniformity;
@@ -263,6 +269,7 @@ const UniformityTable = ({ refresh }: { refresh?: () => void }) => {
}, },
}, },
{ {
id: 'actions',
header: 'Aksi', header: 'Aksi',
cell: (props: CellContext<Uniformity, unknown>) => { cell: (props: CellContext<Uniformity, unknown>) => {
const currentPageSize = props.table.getPaginationRowModel().rows.length; const currentPageSize = props.table.getPaginationRowModel().rows.length;