refactor(FE-remove-filter): Make select inputs clearable in

DashboardProduction and remove filter from kandang
This commit is contained in:
rstubryan
2026-04-13 11:32:48 +07:00
parent b580a01bdc
commit 3ad04e5bac
@@ -117,20 +117,21 @@ const DashboardProduction = () => {
} = useSelect(ProjectFlockApi.basePath, 'id', 'flock_name', '', { } = useSelect(ProjectFlockApi.basePath, 'id', 'flock_name', '', {
location_id: selectedLocationIds ? selectedLocationIds.toString() : '', location_id: selectedLocationIds ? selectedLocationIds.toString() : '',
}); });
const { const {
setInputValue: setInputValueLocation, setInputValue: setInputValueLocation,
options: locationOptions, options: locationOptions,
isLoadingOptions: isLoadingLocationOptions, isLoadingOptions: isLoadingLocationOptions,
loadMore: loadMoreLocation, loadMore: loadMoreLocation,
} = useSelect(LocationApi.basePath, 'id', 'name'); } = useSelect(LocationApi.basePath, 'id', 'name');
const { const {
setInputValue: setInputValueKandang, setInputValue: setInputValueKandang,
options: kandangOptions, options: kandangOptions,
isLoadingOptions: isLoadingKandangOptions, isLoadingOptions: isLoadingKandangOptions,
loadMore: loadMoreKandang, loadMore: loadMoreKandang,
} = useSelect(KandangApi.basePath, 'id', 'name', '', { } = useSelect(KandangApi.basePath, 'id', 'name', '');
location_id: selectedLocationIds ? selectedLocationIds.toString() : '',
});
const comparisonTypeOptions = [ const comparisonTypeOptions = [
{ value: 'FARM', label: 'Farm' }, { value: 'FARM', label: 'Farm' },
{ value: 'FLOCK', label: 'Flock' }, { value: 'FLOCK', label: 'Flock' },
@@ -505,6 +506,7 @@ const DashboardProduction = () => {
className={{ className={{
select: 'rounded-lg text-sm border-base-content/10', select: 'rounded-lg text-sm border-base-content/10',
}} }}
isClearable={true}
/> />
)} )}
@@ -541,6 +543,7 @@ const DashboardProduction = () => {
className={{ className={{
select: 'rounded-lg text-sm border-base-content/10', select: 'rounded-lg text-sm border-base-content/10',
}} }}
isClearable={true}
/> />
) : ( ) : (
<SelectInputRadio <SelectInputRadio
@@ -572,6 +575,7 @@ const DashboardProduction = () => {
className={{ className={{
select: 'rounded-lg text-sm border-base-content/10', select: 'rounded-lg text-sm border-base-content/10',
}} }}
isClearable={true}
/> />
)} )}
@@ -611,6 +615,7 @@ const DashboardProduction = () => {
className={{ className={{
select: 'rounded-lg text-sm border-base-content/10', select: 'rounded-lg text-sm border-base-content/10',
}} }}
isClearable={true}
/> />
) : ( ) : (
<SelectInputRadio <SelectInputRadio
@@ -637,6 +642,7 @@ const DashboardProduction = () => {
className={{ className={{
select: 'rounded-lg text-sm border-base-content/10', select: 'rounded-lg text-sm border-base-content/10',
}} }}
isClearable={true}
/> />
)} )}
</> </>
@@ -675,6 +681,7 @@ const DashboardProduction = () => {
className={{ className={{
select: 'rounded-lg text-sm border-base-content/10', select: 'rounded-lg text-sm border-base-content/10',
}} }}
isClearable={true}
/> />
) : ( ) : (
<SelectInputRadio <SelectInputRadio
@@ -701,6 +708,7 @@ const DashboardProduction = () => {
className={{ className={{
select: 'rounded-lg text-sm border-base-content/10', select: 'rounded-lg text-sm border-base-content/10',
}} }}
isClearable={true}
/> />
)} )}
</> </>