var j=(c,r,n)=>new Promise((s,d)=>{var g=t=>{try{o(n.next(t))}catch(x){d(x)}},N=t=>{try{o(n.throw(t))}catch(x){d(x)}},o=t=>t.done?s(t.value):Promise.resolve(t.value).then(g,N);o((n=n.apply(c,r)).next())});import{j as e,B as m,L as u,e as v,D as y,f as b,g as C,h as P,i as _,k as D,l as E}from"./index-C7Y5J1TO.js";import{u as k}from"./useQuery-DGaD2i6Y.js";import{g as A}from"./studios-services-TLqg2xMe.js";import{P as M,a as S,b as l,c as T,d as h,e as F,f as I,C as B}from"./pagination-DcGqVpvk.js";import{G}from"./generic-filter-CfzHACFN.js";import{B as p}from"./badge-DLmsfCsp.js";import{C as L,a as q}from"./card-DDrJ6Iia.js";import{T as z,a as H,b as f,c as i,d as R,e as a}from"./table-DmBfZH6x.js";import"./label-CbvzEgFe.js";import"./popover-CtxAPxyq.js";const U=()=>{const{isPending:c,data:r,isError:n,error:s}=k({queryKey:["getStudios"],queryFn:()=>j(null,null,function*(){const d=yield A();if(d.status==200)return d.data.studios;throw new Error("Error fetching")})});return{isPending:c,studios:r,isError:n,error:s}};function K(){return e.jsx(M,{children:e.jsxs(S,{children:[e.jsx(l,{children:e.jsx(T,{href:"#"})}),e.jsx(l,{children:e.jsx(h,{href:"#",children:"1"})}),e.jsx(l,{children:e.jsx(h,{href:"#",isActive:!0,children:"2"})}),e.jsx(l,{children:e.jsx(h,{href:"#",children:"3"})}),e.jsx(l,{children:e.jsx(F,{})}),e.jsx(l,{children:e.jsx(I,{href:"#"})})]})})}function se(){const c=[{key:"username",label:"Usuario",value:""},{key:"email",label:"Email",value:""},{key:"payment_method",label:"Método de pago",value:""}],{studios:r}=U();function n(s){console.log("Filtros aplicados:",s)}return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-primary text-3xl font-bold",children:"Administrar estudios"}),e.jsx("small",{className:"text-muted-foreground",children:"Aquí podrás administrar los estudios"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(G,{filtersConfig:c,onFilterApply:n}),e.jsx(m,{asChild:!0,size:"sm",variant:"primary-soft",children:e.jsxs(u,{className:"flex gap-1",to:"/admin/entailment/studios/create",children:[e.jsx(v,{}),"Crear"]})})]})]}),e.jsx(L,{className:"py-4 xl:col-span-2","x-chunk":"dashboard-01-chunk-4",children:e.jsx(q,{children:e.jsxs(z,{children:[e.jsx(H,{children:e.jsxs(f,{children:[e.jsx(i,{children:"# ID"}),e.jsx(i,{children:"Nombre de estudio"}),e.jsx(i,{children:"Especialista asignado"}),e.jsx(i,{children:"Unido en "}),e.jsx(i,{className:"text-center",children:"Información personal "}),e.jsx(i,{className:"text-center",children:"Información de pago "}),e.jsx(i,{className:"text-center",children:"Documentos "}),e.jsx(i,{className:"text-center",children:"Estado"}),e.jsx(i,{className:"text-center",children:"Se paga"}),e.jsx(i,{className:"text-center",children:"Actions"})]})}),e.jsx(R,{children:r==null?void 0:r.map(s=>e.jsxs(f,{children:[e.jsx(a,{children:e.jsx("div",{children:s.id})}),e.jsx(a,{children:e.jsx("div",{children:s.studio_name})}),e.jsx(a,{children:e.jsx("div",{children:s.assigned_specialist})}),e.jsx(a,{children:e.jsx("div",{children:s.joined_at})}),e.jsx(a,{className:"text-center",children:e.jsxs("div",{children:[s.completion_percentages.personal_info,"%"]})}),e.jsx(a,{className:"text-center",children:e.jsxs("div",{children:[s.completion_percentages.payment_info,"%"]})}),e.jsx(a,{className:"text-center",children:e.jsxs("div",{children:[s.completion_percentages.documents,"%"]})}),e.jsx(a,{className:"text-center",children:e.jsx("div",{children:e.jsx(p,{variant:s.status?"success-soft":"danger-soft",children:s.status?"Activo":"Inactivo"})})}),e.jsx(a,{className:"text-center",children:e.jsx("div",{children:e.jsx(p,{variant:s.is_paid?"success-soft":"danger-soft",children:s.is_paid?"Si":"No"})})}),e.jsx(a,{className:"text-center",children:e.jsxs(y,{children:[e.jsx(b,{asChild:!0,children:e.jsx(m,{size:"sm",variant:"outline",children:e.jsx(C,{})})}),e.jsxs(P,{children:[e.jsx(_,{children:"Acciones"}),e.jsx(D,{}),e.jsx(E,{children:e.jsxs(u,{to:""+s.id,className:"flex",children:[e.jsx(B,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Modificar"})]})})]})]})})]},s.id))})]})})}),e.jsx(K,{})]})}export{se as default};
