mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +00:00
feat/FE/US-34/TASK-52-53-slicing-ui-table-adjust-form-with-api
This commit is contained in:
@@ -156,11 +156,9 @@ const InventoryAdjustmentTable = () => {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`small mx-auto badge badge-soft ${
|
||||
type === 'INCREASE'
|
||||
? 'badge-success'
|
||||
: 'badge-error'
|
||||
}`}
|
||||
className={`small mx-auto badge badge-soft ${
|
||||
type === 'INCREASE' ? 'badge-success' : 'badge-error'
|
||||
}`}
|
||||
>
|
||||
{label}
|
||||
</div>
|
||||
@@ -172,33 +170,33 @@ const InventoryAdjustmentTable = () => {
|
||||
header: 'Oleh',
|
||||
accessorFn: (row) => row.created_user?.name ?? '-',
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
header: 'Aksi',
|
||||
cell: (props) => {
|
||||
const currentPageSize = props.table.getPaginationRowModel().rows.length;
|
||||
const currentPageRows = props.table.getPaginationRowModel().flatRows;
|
||||
const currentRowRelativeIndex =
|
||||
currentPageRows.findIndex((r) => r.id === props.row.id) + 1;
|
||||
// {
|
||||
// id: 'actions',
|
||||
// header: 'Aksi',
|
||||
// cell: (props) => {
|
||||
// const currentPageSize = props.table.getPaginationRowModel().rows.length;
|
||||
// const currentPageRows = props.table.getPaginationRowModel().flatRows;
|
||||
// const currentRowRelativeIndex =
|
||||
// currentPageRows.findIndex((r) => r.id === props.row.id) + 1;
|
||||
|
||||
const isLast2Rows = currentRowRelativeIndex > currentPageSize - 2;
|
||||
// const isLast2Rows = currentRowRelativeIndex > currentPageSize - 2;
|
||||
|
||||
return (
|
||||
<>
|
||||
{currentPageSize > 2 && (
|
||||
<RowDropdownOptions isLast2Rows={isLast2Rows}>
|
||||
<RowOptionsMenu type='dropdown' props={props} />
|
||||
</RowDropdownOptions>
|
||||
)}
|
||||
{currentPageSize <= 2 && (
|
||||
<RowCollapseOptions>
|
||||
<RowOptionsMenu type='dropdown' props={props} />
|
||||
</RowCollapseOptions>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
},
|
||||
},
|
||||
// return (
|
||||
// <>
|
||||
// {currentPageSize > 2 && (
|
||||
// <RowDropdownOptions isLast2Rows={isLast2Rows}>
|
||||
// <RowOptionsMenu type='dropdown' props={props} />
|
||||
// </RowDropdownOptions>
|
||||
// )}
|
||||
// {currentPageSize <= 2 && (
|
||||
// <RowCollapseOptions>
|
||||
// <RowOptionsMenu type='dropdown' props={props} />
|
||||
// </RowCollapseOptions>
|
||||
// )}
|
||||
// </>
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
];
|
||||
|
||||
// Handler
|
||||
|
||||
Reference in New Issue
Block a user