import{jsx as t}from"react/jsx-runtime";import{memo as e,useMemo as r,useCallback as o}from"react";import{FilterType as i}from"../../../../constants.js";import{usePickerPropsStore as l}from"../../../../stores/picker-props-store/usePickerPropsStore.js";import{useFilterStore as n}from"../../../../stores/filter-store/useFilterStore.js";import{useIsAllWellsLoading as s}from"../../../../hooks/useIsAllWellsLoading.js";import{isAllOrNoneSelected as a}from"../../utils/isAllOrNoneSelected.js";import{MultiFilterSelect as m}from"../MultiFilterSelect/MultiFilterSelect.js";var u=e((function(e){var u=e.value,c=e.label,p=e.options,d=e.handleChangeFilter,f=e.dropdownClassName,j=l((function(t){return t.isLoadAllWells})),v=s(),g=n((function(t){return t.filters[u]||[]})),h=u===i.company,F=r((function(){return h?p.map((function(t){return{id:t.id,title:t.name}})):p.map((function(t){return{id:t,title:t}}))}),[p,h]),S=o((function(t){var e=a(t,p.length);h?d(u,e?j?[]:void 0:t):d(u,e?void 0:t)}),[p.length,h,j,d,u]);return t(m,{label:c,options:F,value:g,onChange:S,testId:"".concat("Filter","_select_").concat(c),dropdownClassName:f,loading:h&&v,disabled:!h&&v})}));u.displayName="FilterItem";export{u as FilterItem};
//# sourceMappingURL=FilterItem.js.map
