Your IP : 216.73.216.93


Current Path : /home/users/unlimited/www/admin.medimeet.codeskitter.site/assets/
Upload File :
Current File : /home/users/unlimited/www/admin.medimeet.codeskitter.site/assets/UsersComboBox-BR1MkjhI.js

import{r as l,a0 as u,j as s,x as m,T as C,B as g}from"./index-f5FVPPWf.js";import{P as w,a as $,C as v,b as _,c as N,d as k,e as y,f as S,g as E,h as z}from"./popover-BeKqgCqh.js";function I({data:n,setState:f,name:r,defaultData:o,addNew:b,addOpen:j}){const[h,d]=l.useState(!1),[p,x]=l.useState(""),{colorMode:a}=u(),[t,i]=l.useState();return l.useEffect(()=>{if(o){const e=n==null?void 0:n.find(c=>typeof o=="string"?c.id===Number(o):typeof o=="object"&&o!==null?c.f_name===o.f_name&&c.l_name===o.l_name&&c.phone===o.phone:!1);e&&(x(e),f(e),i(e))}},[o,n,f]),s.jsxs(w,{open:h,onOpenChange:d,children:[s.jsx($,{asChild:!0,children:s.jsxs(m,{fontWeight:"500",justifyContent:"space-between",variant:"outline",role:"combobox","aria-expanded":h,className:`w-[100%] h-8 justify-between bg-transparent hover:bg-transparent hover:text-inherit rounded-[6px] capitalize text-sm ${a==="dark"?"border-[#ffffff3d]":"border-[#E2e8f0]"}}`,children:[p?`${p.f_name} ${p.l_name}`:`Select ${r}`,s.jsx(v,{className:"ml-2 h-4 w-4 shrink-0 "})]})}),s.jsx(_,{className:`w-[300px] p-0 max-h-[240px] overflow-y-scroll hideScrollbar z-[1500] ${a==="dark"?"bg-[#2D3748]":"bg-[#ffffff]"}`,children:s.jsxs(N,{className:`${a==="dark"?"bg-[#2D3748]":"bg-[#ffffff]"}`,children:[s.jsx(k,{placeholder:`Search ${r}`,className:a==="dark"?"text-[#fff]":"text-[#000]"}),s.jsxs(y,{children:[s.jsxs(C,{children:["No ",r," found."]}),b&&s.jsx(g,{w:"100%",px:4,mt:2,children:s.jsxs(m,{size:"sm",w:"100%",colorScheme:"blue",onClick:()=>{d(!1),j()},children:["Add ",r]})})]}),s.jsx(S,{children:n==null?void 0:n.map(e=>s.jsxs(E,{value:`${e.f_name.toString()} ${e.l_name.toString()} ${e.phone}`,onSelect:()=>{d(!1),x(e),i(e),f(e)},className:"dark:text-white capitalize",children:[s.jsx(z,{className:`mr-2 h-4 w-4 ${e.id===(t==null?void 0:t.id)?"opacity-100":"opacity-0"}`}),e.f_name," ",e.l_name," ",e.phone]},e.id))})]})})]})}export{I as U};