Files
cirux/.next/static/chunks/app/dashboard/appointments/page-0adca1e932f98426.js
T
2026-06-03 15:08:40 -05:00

1 line
7.5 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8876],{11647:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var a=r(21083),s=r(22027),d=r(83101),n=r(64269);let o=(0,d.F)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:r="default",render:d,...l}=e;return(0,s.C)({defaultTagName:"span",props:(0,a.v6)({className:(0,n.cn)(o({variant:r}),t)},l),render:d,state:{slot:"badge",variant:r}})}},20243:(e,t,r)=>{"use strict";r.d(t,{E:()=>d});var a=r(95155),s=r(64269);function d(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"skeleton",className:(0,s.cn)("animate-pulse rounded-md bg-muted",t),...r})}},22027:(e,t,r)=>{"use strict";r.d(t,{C:()=>s});var a=r(87711);function s(e){return(0,a.o)(e.defaultTagName??"div",e,e)}},32938:(e,t,r)=>{Promise.resolve().then(r.bind(r,77739))},64269:(e,t,r)=>{"use strict";r.d(t,{cn:()=>d});var a=r(2821),s=r(75889);function d(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.QP)((0,a.$)(t))}},77650:(e,t,r)=>{"use strict";r.d(t,{U:()=>s});var a=r(79786);function s(){return(0,a.createBrowserClient)("https://supabase.silvioalzate.shop","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzc5MTYzNDQ1LCJleHAiOjE5MzY4NDM0NDV9.RGVwyQdA7oigXmMylP2Df7DKpNno_8_rSTwd0471zLk")}},77739:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var a=r(95155),s=r(12115),d=r(77650),n=r(86948),o=r(11647),l=r(20243),i=r(71163),c=r(35056);let u={confirmed:{label:"Confirmada",className:"bg-emerald-50 text-emerald-700 border-emerald-200"},cancelled:{label:"Cancelada",className:"bg-red-50 text-red-700 border-red-200"},completed:{label:"Completada",className:"bg-gray-50 text-gray-600 border-gray-200"},reschedule:{label:"Reprogramar",className:"bg-yellow-50 text-yellow-700 border-yellow-200"}};function m(){let e=(0,s.useMemo)(()=>(0,d.U)(),[]),[t,r]=(0,s.useState)([]),[m,p]=(0,s.useState)(!0),x=(0,s.useCallback)(async()=>{try{let{data:t,error:a}=await e.from("slots").select("*, patient:patients(name, phone), procedure:procedures(name)").eq("block_type","appointment").order("created_at",{ascending:!1}).limit(100);a&&console.error("Slots query error:",a.message),t&&r(t)}catch(e){console.error("Slots fetch error:",e.message)}finally{p(!1)}},[e]);return(0,s.useEffect)(()=>{x();let t=e.channel("appointments-list").on("postgres_changes",{event:"*",schema:"public",table:"slots",filter:"block_type=eq.appointment"},()=>{x()}).subscribe();return()=>{e.removeChannel(t)}},[x,e]),(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"font-heading font-bold text-2xl text-foreground",children:"Citas"}),(0,a.jsx)("p",{className:"text-muted-foreground text-sm mt-1",children:"Historial completo de citas del consultorio"})]}),(0,a.jsx)(n.Zp,{className:"border-border",children:(0,a.jsx)(n.Wu,{className:"pt-6",children:m?(0,a.jsx)("div",{className:"space-y-3",children:Array.from({length:5}).map((e,t)=>(0,a.jsx)(l.E,{className:"h-14 rounded-[12px]"},t))}):0===t.length?(0,a.jsx)("div",{className:"h-40 flex items-center justify-center text-muted-foreground text-sm",children:"No hay citas registradas."}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("caption",{className:"sr-only",children:"Listado de citas del consultorio"}),(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"text-left text-muted-foreground text-xs uppercase tracking-wide border-b border-border",children:[(0,a.jsx)("th",{scope:"col",className:"pb-3 pr-4 font-medium",children:"Paciente"}),(0,a.jsx)("th",{scope:"col",className:"pb-3 pr-4 font-medium",children:"Procedimiento"}),(0,a.jsx)("th",{scope:"col",className:"pb-3 pr-4 font-medium",children:"Canal"}),(0,a.jsx)("th",{scope:"col",className:"pb-3 pr-4 font-medium",children:"Fecha y hora"}),(0,a.jsx)("th",{scope:"col",className:"pb-3 font-medium",children:"Estado"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border/50",children:t.map(e=>{var t,r,s,d,n,l,m;let p=null!=(d=u[e.status])?d:u.confirmed;return(0,a.jsxs)("tr",{className:"hover:bg-muted/30 transition-colors",children:[(0,a.jsxs)("td",{className:"py-3 pr-4",children:[(0,a.jsx)("p",{className:"font-medium text-foreground",children:null!=(n=null==(t=e.patient)?void 0:t.name)?n:"—"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:null!=(l=null==(r=e.patient)?void 0:r.phone)?l:""})]}),(0,a.jsx)("td",{className:"py-3 pr-4 text-foreground",children:null!=(m=null==(s=e.procedure)?void 0:s.name)?m:"—"}),(0,a.jsx)("td",{className:"py-3 pr-4 text-muted-foreground capitalize",children:e.channel}),(0,a.jsx)("td",{className:"py-3 pr-4 text-foreground",children:e.start_at?(0,i.GP)(new Date(e.start_at),"dd MMM yyyy \xb7 HH:mm",{locale:c.es}):"—"}),(0,a.jsx)("td",{className:"py-3",children:(0,a.jsx)(o.E,{variant:"outline",className:"text-[10px] ".concat(p.className),children:p.label})})]},e.id)})})]})})})})]})}},86948:(e,t,r)=>{"use strict";r.d(t,{BT:()=>l,Wu:()=>i,ZB:()=>o,Zp:()=>d,aR:()=>n});var a=r(95155);r(12115);var s=r(64269);function d(e){let{className:t,size:r="default",...d}=e;return(0,a.jsx)("div",{"data-slot":"card","data-size":r,className:(0,s.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...d})}function n(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",t),...r})}function o(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...r})}function l(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-sm text-muted-foreground",t),...r})}function i(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-4 group-data-[size=sm]/card:px-3",t),...r})}}},e=>{e.O(0,[5730,7711,7349,3540,8814,8441,1255,7358],()=>e(e.s=32938)),_N_E=e.O()}]);