import{j as e,S as w,B as c}from"./vendor-mui-CBBEb17G.js";import{aP as E,aR as k,aS as y}from"./index-IP_FWtso.js";import{a as s}from"./vendor-react-BBazpZul.js";const B=({onRefresh:l,onSearch:x,width:u,label:d,refreshContent:f,searchContent:h,className:m,refreshProps:p,searchProps:j})=>{const[r,n]=s.useState(""),[o,t]=s.useState(!1),i=()=>{if(!r){t(!0);return}x(r)},S=()=>{n(""),t(!1),l()};return s.useEffect(()=>{r&&o&&t(!1)},[r]),e.jsxs(w,{justifyContent:"start",direction:"row",spacing:1,sx:{width:u||300},className:m,children:[e.jsx(E,{onChange:a=>n(a),value:r,label:d||"جستجو...",fullWidth:!0,error:o,onKeyDown:a=>{a.key==="Enter"&&i()}}),e.jsx(c,{onClick:i,variant:"contained",color:"primary",className:"!min-w-[40px] !rounded-[15px]",...j,children:h||e.jsx(k,{})}),e.jsx(c,{onClick:S,variant:"contained",color:"info",className:"!min-w-[40px] !rounded-[15px]",...p,children:f||e.jsx(y,{})})]})};export{B as S};
