import{c as f,r as t}from"./index-dP1W1_bd.js";const p=(r=!1)=>{const[S,e]=f(r),[l,c]=t.useState(null),[a,n]=t.useState(null),[o,d]=t.useState(""),m=t.useCallback((s,u)=>()=>{c(s),u&&n(u),l||e()},[e,l,a]),i=s=>{d(s),o||e()},I=t.useCallback(()=>{c(null),n(null),d(""),e()},[e]);return{isOpen:S,selectedId:l,selectedName:o,selectedFgId:a,handleClose:I,handleSelectItem:m,handleSelectItemByName:i}};export{p as u};
