diff --git a/src/components/pages/production/transfer-to-laying/TransferToLayingsTable.tsx b/src/components/pages/production/transfer-to-laying/TransferToLayingsTable.tsx index 309c42b2..3298b0fc 100644 --- a/src/components/pages/production/transfer-to-laying/TransferToLayingsTable.tsx +++ b/src/components/pages/production/transfer-to-laying/TransferToLayingsTable.tsx @@ -1,6 +1,6 @@ 'use client'; -import { ChangeEventHandler, useEffect, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import useSWR from 'swr'; import { CellContext, @@ -12,30 +12,28 @@ import toast from 'react-hot-toast'; import { Icon } from '@iconify/react'; import Table from '@/components/Table'; -import DebouncedTextInput from '@/components/input/DebouncedTextInput'; import Button from '@/components/Button'; import { useModal } from '@/components/Modal'; import ConfirmationModal from '@/components/modal/ConfirmationModal'; -import SelectInput, { - OptionType, - useSelect, -} from '@/components/input/SelectInput'; import CheckboxInput from '@/components/input/CheckboxInput'; import ConfirmationModalWithNotes from '@/components/modal/ConfirmationModalWithNotes'; import RequirePermission from '@/components/helper/RequirePermission'; -import DateInput from '@/components/input/DateInput'; import PopoverButton from '@/components/popover/PopoverButton'; +import Badge from '@/components/Badge'; +import PopoverContent from '@/components/popover/PopoverContent'; +import Dropdown from '@/components/Dropdown'; +import StatusBadge from '@/components/helper/StatusBadge'; +import TransferToLayingFilterModal from '@/components/pages/production/transfer-to-laying/TransferToLayingFilterModal'; -import { TransferToLaying } from '@/types/api/production/transfer-to-laying'; +import { + TransferToLaying, + TransferToLayingFilter, +} from '@/types/api/production/transfer-to-laying'; import { TransferToLayingApi } from '@/services/api/production/transfer-to-laying'; import { cn, formatDate } from '@/lib/helper'; import { isResponseError, isResponseSuccess } from '@/lib/api-helper'; import { useTableFilter } from '@/services/hooks/useTableFilter'; -import { Flock } from '@/types/api/master-data/flock'; -import { ProjectFlockApi } from '@/services/api/production'; -import Badge from '@/components/Badge'; import { Color } from '@/types/theme'; -import PopoverContent from '@/components/popover/PopoverContent'; const RowOptionsMenu = ({ props, @@ -56,8 +54,8 @@ const RowOptionsMenu = ({ const showDeleteButton = showEditButton; - const showApproveButton = showEditButton; - const showRejectButton = showEditButton; + // const showApproveButton = showEditButton; + // const showRejectButton = showEditButton; const popoverId = `transferToLaying#${props.row.original.id}`; const popoverAnchorName = `--anchor-transferToLaying#${props.row.original.id}`; @@ -78,7 +76,7 @@ const RowOptionsMenu = ({ id={popoverId} anchorName={popoverAnchorName} position={popoverPosition === 'bottom' ? 'bottom-start' : 'left'} - className='rounded-xl border border-base-content/5 shadow-sm' + className='w-full max-w-40 rounded-xl border border-base-content/5 shadow-sm' >
@@ -107,7 +105,7 @@ const RowOptionsMenu = ({ )} - {showApproveButton && ( + {/* {showApproveButton && ( - +
+
+
+ + + - {selectedRowIds.length > 0 && ( - <> - - - + {selectedRowIds.length > 0 && ( + <> +
- - - - - )} -
+ + + - + + + + + )}
-
- +
+ - + trigger={ + + } + > + +
@@ -652,7 +653,7 @@ const TransferToLayingsTable = () => { enableRowSelection={tableEnableRowSelectionHandler} withCheckbox className={{ - containerClassName: cn({ + containerClassName: cn('p-3', { 'w-full mb-20': isResponseSuccess(transferToLayings) && transferToLayings?.data?.length === 0, @@ -662,15 +663,23 @@ const TransferToLayingsTable = () => { />
+ + { {