import{aT as _,j as e,cO as h,aS as N,b2 as p,bd as u,be as j,b4 as g,cG as b,a$ as v}from"./react-vendor-xYZnmIII.js";import{D as w}from"./delete-modal-h3jQBOO6.js";import{a as f,B as n,E as y,F as z,G as P,H as I}from"./ui-components-CQM92IK3.js";import{P as k}from"./richtor-BECSBxkh.js";import A from"./live-class-form-C60YhvYc.js";import E from"./live-class-status-qV1qMwk9.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./interactive-vendor-B1OgcAgP.js";import"./datetime-picker-By0-QSwT.js";import"./use-lang-Dg6I_Fym.js";import"./input-error-_LAmvivg.js";const L=c=>{const{zoom_account_email:r,zoom_account_id:t,zoom_client_id:s,zoom_client_secret:l}=c;return!!(r&&t&&s&&l)},W=()=>{const{props:c}=_(),{translate:r}=c,{dashboard:t,button:s}=r,{course:l,zoomConfig:o}=c,i=L(o),d=l.live_classes||[];return e.jsx(f,{className:"container p-4 sm:p-6",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-xl font-bold",children:t.live_classes}),e.jsx("div",{className:"flex items-center gap-3",children:i?e.jsx(A,{courseId:l.id,title:s.schedule_class,handler:e.jsxs(n,{className:"flex items-center gap-2",children:[e.jsx(h,{className:"h-4 w-4"}),s.schedule_class]})}):e.jsxs(n,{disabled:!0,className:"flex items-center gap-2",children:[e.jsx(h,{className:"h-4 w-4"}),s.schedule_class]})})]}),e.jsx("div",{className:"space-y-4",children:d.length===0?e.jsxs("div",{children:[!i&&e.jsxs("p",{className:"bg-destructive/5 dark:bg-destructive/30 rounded-lg p-3 text-center text-sm text-red-500",children:[t.zoom_not_enabled_message," ",e.jsx(N,{href:route("settings.live-class"),className:"text-blue-500 hover:underline",children:t.enable_zoom})]}),e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(p,{className:"mx-auto mb-4 h-12 w-12 text-gray-400"}),e.jsx("h3",{className:"mb-2 text-lg font-medium",children:t.no_live_classes_scheduled}),e.jsx("p",{className:"text-gray-500",children:t.schedule_first_live_class})]})]}):d.map(a=>{var m,x;return e.jsxs(f,{className:"p-6",children:[e.jsxs("div",{className:"flex flex-col items-start justify-between gap-6 md:flex-row",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"mb-4 text-lg font-semibold",children:a.class_topic}),e.jsxs("div",{className:"text-muted-foreground mb-4 space-y-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{children:u(j(a.class_date_and_time),"PPP")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:"h-4 w-4"}),e.jsx("span",{children:u(j(a.class_date_and_time),"p")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{className:"h-4 w-4"}),e.jsxs("span",{children:[s.instructor,": ",((x=(m=l.instructor)==null?void 0:m.user)==null?void 0:x.name)||"Unknown"]})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(E,{courseId:l.id,liveClass:a,zoomConfig:o}),e.jsx(w,{routePath:route("live-class.destroy",a.id),actionComponent:e.jsxs(n,{size:"sm",variant:"outline",className:"flex w-full items-center gap-1 text-red-600 hover:text-red-700",children:[e.jsx(v,{className:"h-3 w-3"}),s.delete_class]})})]})]}),a.class_note&&e.jsx(y,{type:"single",collapsible:!0,className:"mt-4 w-full",children:e.jsxs(z,{value:"item-1",className:"bg-muted overflow-hidden rounded-lg border-none",children:[e.jsx(P,{className:"[&[data-state=open]]:!bg-secondary-lighter px-4 py-2 text-base font-medium hover:no-underline",children:s.class_note}),e.jsx(I,{className:"p-4",children:e.jsx(k,{value:a.class_note})})]})})]},a.id)})})]})})};export{W as default};
