mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE): Use accessorKey/styled headers and remove dead code
This commit is contained in:
@@ -112,11 +112,19 @@ const UniformityConfirmationPreview = ({
|
||||
|
||||
const columns: ColumnDef<DetailOptionType>[] = [
|
||||
{
|
||||
header: 'Label',
|
||||
accessorKey: 'label',
|
||||
enableSorting: false,
|
||||
header: () => (
|
||||
<span className='font-medium text-sm leading-[150%]'>Label</span>
|
||||
),
|
||||
cell: (props) => props.row.original.label,
|
||||
},
|
||||
{
|
||||
header: 'Value',
|
||||
accessorKey: 'value',
|
||||
enableSorting: false,
|
||||
header: () => (
|
||||
<span className='font-medium text-sm leading-[150%]'>Value</span>
|
||||
),
|
||||
cell: (props) => {
|
||||
const id = props.row.original.id;
|
||||
const value = props.row.original.value;
|
||||
@@ -214,7 +222,6 @@ const UniformityTable = () => {
|
||||
const [isBulkActionLoading, setIsBulkActionLoading] = useState(false);
|
||||
const [isPdfExportLoading, setIsPdfExportLoading] = useState(false);
|
||||
const [isExcelExportLoading, setIsExcelExportLoading] = useState(false);
|
||||
const isAnyExportLoading = isPdfExportLoading || isExcelExportLoading;
|
||||
|
||||
const singleDeleteModal = useModal();
|
||||
const successModal = useModal();
|
||||
@@ -238,7 +245,7 @@ const UniformityTable = () => {
|
||||
const [filterEndDate, setFilterEndDate] = useState('');
|
||||
const [filterProjectFlockLocationId, setFilterProjectFlockLocationId] =
|
||||
useState<string>('');
|
||||
const [filterErrors, setFilterErrors] = useState<Record<string, string>>({});
|
||||
const [, setFilterErrors] = useState<Record<string, string>>({});
|
||||
|
||||
const {
|
||||
setInputValue: setFilterLocationInputValue,
|
||||
@@ -309,7 +316,6 @@ const UniformityTable = () => {
|
||||
? projectFlockKandangLookupData.data
|
||||
: undefined;
|
||||
|
||||
// Update filterProjectFlockKandangId when lookup changes
|
||||
useEffect(() => {
|
||||
if (projectFlockKandangLookup?.id) {
|
||||
setFilterProjectFlockKandangId(projectFlockKandangLookup.id);
|
||||
@@ -483,12 +489,6 @@ const UniformityTable = () => {
|
||||
[filterFormik]
|
||||
);
|
||||
|
||||
const handleApplyFilters = useCallback(() => {
|
||||
handleFormSubmit(
|
||||
new Event('submit') as unknown as React.FormEvent<HTMLFormElement>
|
||||
);
|
||||
}, [handleFormSubmit]);
|
||||
|
||||
const selectedRowIds = useMemo(() => {
|
||||
return Object.keys(rowSelection)
|
||||
.filter((key) => rowSelection[key])
|
||||
@@ -1076,7 +1076,7 @@ const UniformityTable = () => {
|
||||
modalBox: 'rounded-2xl',
|
||||
}}
|
||||
>
|
||||
<div className='flex flex-col gap-4 mt-4'>
|
||||
<div className='flex flex-col gap-4'>
|
||||
{createdUniformity ? (
|
||||
<UniformityConfirmationPreview
|
||||
uniformityDetail={createdUniformity}
|
||||
@@ -1112,7 +1112,7 @@ const UniformityTable = () => {
|
||||
modalBox: 'rounded-2xl',
|
||||
}}
|
||||
>
|
||||
<div className='flex flex-col gap-4 mt-4'>
|
||||
<div className='flex flex-col gap-4'>
|
||||
<UniformityConfirmationPreview uniformity={selectedUniformity} />
|
||||
</div>
|
||||
</ConfirmationModal>
|
||||
@@ -1136,7 +1136,7 @@ const UniformityTable = () => {
|
||||
modalBox: 'rounded-2xl',
|
||||
}}
|
||||
>
|
||||
<div className='flex flex-col gap-4 mt-4'>
|
||||
<div className='flex flex-col gap-4'>
|
||||
{selectedRowIds.length === 1 ? (
|
||||
<UniformityConfirmationPreview
|
||||
uniformity={selectedUniformities[0]}
|
||||
@@ -1168,7 +1168,7 @@ const UniformityTable = () => {
|
||||
modalBox: 'rounded-2xl',
|
||||
}}
|
||||
>
|
||||
<div className='flex flex-col gap-4 mt-4'>
|
||||
<div className='flex flex-col gap-4'>
|
||||
<UniformityConfirmationPreview uniformity={selectedUniformity} />
|
||||
</div>
|
||||
</ConfirmationModal>
|
||||
@@ -1192,7 +1192,7 @@ const UniformityTable = () => {
|
||||
modalBox: 'rounded-2xl',
|
||||
}}
|
||||
>
|
||||
<div className='flex flex-col gap-4 mt-4'>
|
||||
<div className='flex flex-col gap-4'>
|
||||
{selectedRowIds.length === 1 ? (
|
||||
<UniformityConfirmationPreview
|
||||
uniformity={selectedUniformities[0]}
|
||||
@@ -1224,7 +1224,7 @@ const UniformityTable = () => {
|
||||
modalBox: 'rounded-2xl',
|
||||
}}
|
||||
>
|
||||
<div className='flex flex-col gap-4 mt-4'>
|
||||
<div className='flex flex-col gap-4'>
|
||||
{selectedRowIds.length === 1 ? (
|
||||
<UniformityConfirmationPreview
|
||||
uniformity={selectedUniformities[0]}
|
||||
|
||||
Reference in New Issue
Block a user