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}from"./radixui-DBNNXUn7.js";import{L as m}from"./router-ZPDjRWWZ.js";import{u as v}from"./useQuery-tXf2Qa8J.js";import{g as y}from"./studios-services-jgdX3LyR.js";import{P as b,a as C,b as l,c as P,d as h,e as _,f as D,C as E}from"./pagination-CCE7qJl8.js";import{B as p,e as A,D as M,f as S,G as T,g as k,h as F,i as G,j as I}from"./index-C1-9bQes.js";import{G as B}from"./generic-filter-BigdvSBE.js";import{B as u}from"./badge-BMZJ96FB.js";import{C as L,a as q}from"./card-BaxfxC-x.js";import{T as z,a as H,b as f,c as i,d as R,e as a}from"./table-Be5yzNoc.js";import"./vendor-C0DUGSOM.js";import"./icons-DvPHMWAM.js";import"./utils-CbOYy0fT.js";import"./label-wWBD5Ozj.js";import"./popover-D_hLgl2z.js";const U=()=>{const{isPending:c,data:r,isError:n,error:s}=v({queryKey:["getStudios"],queryFn:()=>j(null,null,function*(){const d=yield y();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(b,{children:e.jsxs(C,{children:[e.jsx(l,{children:e.jsx(P,{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(_,{})}),e.jsx(l,{children:e.jsx(D,{href:"#"})})]})})}function te(){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(B,{filtersConfig:c,onFilterApply:n}),e.jsx(p,{asChild:!0,size:"sm",variant:"primary-soft",children:e.jsxs(m,{className:"flex gap-1",to:"/admin/entailment/studios/create",children:[e.jsx(A,{}),"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(u,{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(u,{variant:s.is_paid?"success-soft":"danger-soft",children:s.is_paid?"Si":"No"})})}),e.jsx(a,{className:"text-center",children:e.jsxs(M,{children:[e.jsx(S,{asChild:!0,children:e.jsx(p,{size:"sm",variant:"outline",children:e.jsx(T,{})})}),e.jsxs(k,{children:[e.jsx(F,{children:"Acciones"}),e.jsx(G,{}),e.jsx(I,{children:e.jsxs(m,{to:""+s.id,className:"flex",children:[e.jsx(E,{className:"mr-2 h-4 w-4"}),e.jsx("span",{children:"Modificar"})]})})]})]})})]},s.id))})]})})}),e.jsx(K,{})]})}export{te as default};
