+ {/* Modal Header */}
+
+
+
+
Filter Data
+
+
+
+
+
+
- {
- handleFilterLocationChange(value);
- }}
- options={filterLocationOptions}
- onInputChange={setFilterLocationInputValue}
- isLoading={isLoadingFilterLocations}
- onMenuScrollToBottom={loadMoreFilterLocations}
+ label='Tanggal mulai'
+ name='start_date'
+ value={filterFormik.values.start_date}
+ onChange={handleFilterStartDateChange}
+ onBlur={filterFormik.handleBlur}
isError={
- filterFormik.touched.location &&
- Boolean(filterFormik.errors.location)
+ filterFormik.touched.start_date &&
+ Boolean(filterFormik.errors.start_date)
}
- errorMessage={filterFormik.errors.location}
- isClearable
+ errorMessage={filterFormik.errors.start_date}
className={{ wrapper: 'w-full' }}
/>
- {
- handleFilterProjectFlockChange(value);
- }}
- options={filterProjectFlockOptions}
- onInputChange={setFilterProjectFlockSearchValue}
- isLoading={isLoadingFilterProjectFlocks}
- onMenuScrollToBottom={loadMoreFilterProjectFlocks}
- isDisabled={!filterFormik.values.location}
+ label='Tanggal akhir'
+ name='end_date'
+ value={filterFormik.values.end_date}
+ onChange={handleFilterEndDateChange}
+ onBlur={filterFormik.handleBlur}
isError={
- filterFormik.touched.project_flock &&
- Boolean(filterFormik.errors.project_flock)
+ filterFormik.touched.end_date &&
+ Boolean(filterFormik.errors.end_date)
}
- errorMessage={filterFormik.errors.project_flock}
- isClearable
- className={{ wrapper: 'w-full' }}
- />
-
-
-
- {
- handleFilterKandangChange(value);
- }}
- options={filterKandangOptions}
- isDisabled={!filterFormik.values.project_flock}
- isError={
- filterFormik.touched.kandang &&
- Boolean(filterFormik.errors.kandang)
- }
- errorMessage={filterFormik.errors.kandang}
- isClearable
+ errorMessage={filterFormik.errors.end_date}
className={{ wrapper: 'w-full' }}
/>
-
- {/* Error List Alert */}
- {formErrorList.length > 0 && (
-
- )}
+
+ {
+ handleFilterLocationChange(value);
+ }}
+ options={filterLocationOptions}
+ onInputChange={setFilterLocationInputValue}
+ isLoading={isLoadingFilterLocations}
+ onMenuScrollToBottom={loadMoreFilterLocations}
+ isError={
+ filterFormik.touched.location &&
+ Boolean(filterFormik.errors.location)
+ }
+ errorMessage={filterFormik.errors.location}
+ isClearable
+ className={{ wrapper: 'w-full' }}
+ />
- {/* Action Buttons */}
-
-
-
+
+ {
+ handleFilterProjectFlockChange(value);
+ }}
+ options={filterProjectFlockOptions}
+ onInputChange={setFilterProjectFlockSearchValue}
+ isLoading={isLoadingFilterProjectFlocks}
+ onMenuScrollToBottom={loadMoreFilterProjectFlocks}
+ isDisabled={!filterFormik.values.location}
+ isError={
+ filterFormik.touched.project_flock &&
+ Boolean(filterFormik.errors.project_flock)
+ }
+ errorMessage={filterFormik.errors.project_flock}
+ isClearable
+ className={{ wrapper: 'w-full' }}
+ />
+
+
+
+ {
+ handleFilterKandangChange(value);
+ }}
+ options={filterKandangOptions}
+ isDisabled={!filterFormik.values.project_flock}
+ isError={
+ filterFormik.touched.kandang &&
+ Boolean(filterFormik.errors.kandang)
+ }
+ errorMessage={filterFormik.errors.kandang}
+ isClearable
+ className={{ wrapper: 'w-full' }}
+ />
-
- {/* Floating Actions Button */}
-
+ {/* Error List Alert */}
+ {formErrorList.length > 0 && (
+
+ )}
+
+
+ {/* Action Buttons */}
+
+
+
+
+
+
+
+ {/* Floating Actions Button */}
+
-
+ permissions: 'lti.production.uniformity.detail',
+ },
+ {
+ action: 'DELETE',
+ icon: 'mdi:delete-outline',
+ label: 'Delete',
+ hidden: selectedRowIds.length !== 1,
+ onClick: handleDelete,
+ permissions: 'lti.production.uniformity.delete',
+ },
+ ]}
+ approvals={[
+ {
+ action: 'APPROVED',
+ icon: 'mdi:check-circle-outline',
+ label: 'Approve',
+ onClick: handleBulkApprove,
+ permissions: 'lti.production.uniformity.approve',
+ disabled: !canApproveReject,
+ },
+ {
+ action: 'REJECTED',
+ icon: 'mdi:close-circle-outline',
+ label: 'Reject',
+ onClick: handleBulkReject,
+ permissions: 'lti.production.uniformity.approve',
+ disabled: !canApproveReject,
+ },
+ ]}
+ selectedRowIds={selectedRowIds}
+ onClose={handleCloseFab}
+ />
>
);
};
diff --git a/src/components/pages/production/uniformity/detail/UniformityDetailsPreview.tsx b/src/components/pages/production/uniformity/detail/UniformityDetailsPreview.tsx
index 9188ba59..8d38d669 100644
--- a/src/components/pages/production/uniformity/detail/UniformityDetailsPreview.tsx
+++ b/src/components/pages/production/uniformity/detail/UniformityDetailsPreview.tsx
@@ -10,11 +10,10 @@ import {
UniformityInfoUmum,
} from '@/types/api/production/uniformity';
import Table from '@/components/Table';
-import Badge from '@/components/Badge';
+import StatusBadge from '@/components/helper/StatusBadge';
import {
- getWeightStatusColor,
- getWeightStatusIndicatorColor,
getWeightStatusText,
+ getWeightStatusBadgeColor,
} from '@/components/pages/production/uniformity/uniformity-utils';
import { BodyWeightData } from '@/types/api/production/uniformity';
@@ -65,30 +64,12 @@ const UniformityDetailsPreview = ({
cell: (props) => {
const status = props.row.original.status;
return status ? (
-
-
- {getWeightStatusText(status)}
-
-
+
) : (
-
- Unknown
-
+
);
},
},
diff --git a/src/components/pages/production/uniformity/form/UniformityResultForm.tsx b/src/components/pages/production/uniformity/form/UniformityResultForm.tsx
index 103fc791..5963df8a 100644
--- a/src/components/pages/production/uniformity/form/UniformityResultForm.tsx
+++ b/src/components/pages/production/uniformity/form/UniformityResultForm.tsx
@@ -14,12 +14,11 @@ import { useRouter } from 'next/navigation';
import toast from 'react-hot-toast';
import { UniformityApi } from '@/services/api/uniformity';
import { isResponseError } from '@/lib/api-helper';
-import Badge from '@/components/Badge';
+import StatusBadge from '@/components/helper/StatusBadge';
import { formatNumber } from '@/lib/helper';
import {
- getWeightStatusColor,
- getWeightStatusIndicatorColor,
getWeightStatusText,
+ getWeightStatusBadgeColor,
} from '@/components/pages/production/uniformity/uniformity-utils';
import { DetailOptionType } from '@/types/api/production/uniformity';
import {
@@ -204,30 +203,12 @@ const UniformityResultForm = () => {
cell: (props) => {
const status = props.row.original.status;
return status ? (
-
-
- {getWeightStatusText(status)}
-
-
+
) : (
-
- Unknown
-
+
);
},
},