import{jsx as e,jsxs as s}from"react/jsx-runtime";import{D as g}from"./delete-modal-DdJyKUdO.js";import{a as u,B as c,D as v,E as b,F as w,G as y}from"./ui-components-B24mpb8o.js";import{usePage as z,Link as P}from"@inertiajs/react";import{format as f,parseISO as x}from"date-fns";import{Plus as N,Calendar as _,Clock as I,Users as j,Trash2 as k}from"lucide-react";import{Renderer as A}from"richtor";/* empty css                */import L from"./live-class-form-DYT5Yr3w.js";import B from"./live-class-status-DeJCb8ra.js";import"react";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";import"./datetime-picker-CJJWviSb.js";import"./use-lang-Cw_jKJYs.js";import"./input-error-BbsDx4-P.js";const C=i=>{const{zoom_account_email:l,zoom_account_id:a,zoom_client_id:t,zoom_client_secret:o}=i;return!!(l&&a&&t&&o)},ve=()=>{const{props:i}=z(),{translate:l}=i,{dashboard:a,button:t}=l,{course:o,zoomConfig:m}=i,n=C(m),d=o.live_classes||[];return e(u,{className:"container p-4 sm:p-6",children:s("div",{className:"space-y-6",children:[s("div",{className:"flex items-center justify-between",children:[e("h2",{className:"text-xl font-bold",children:a.live_classes}),e("div",{className:"flex items-center gap-3",children:n?e(L,{courseId:o.id,title:t.schedule_class,handler:s(c,{className:"flex items-center gap-2",children:[e(N,{className:"h-4 w-4"}),t.schedule_class]})}):s(c,{disabled:!0,className:"flex items-center gap-2",children:[e(N,{className:"h-4 w-4"}),t.schedule_class]})})]}),e("div",{className:"space-y-4",children:d.length===0?s("div",{children:[!n&&s("p",{className:"bg-destructive/5 dark:bg-destructive/30 rounded-lg p-3 text-center text-sm text-red-500",children:[a.zoom_not_enabled_message," ",e(P,{href:route("settings.live-class"),className:"text-blue-500 hover:underline",children:a.enable_zoom})]}),s("div",{className:"p-8 text-center",children:[e(_,{className:"mx-auto mb-4 h-12 w-12 text-gray-400"}),e("h3",{className:"mb-2 text-lg font-medium",children:a.no_live_classes_scheduled}),e("p",{className:"text-gray-500",children:a.schedule_first_live_class})]})]}):d.map(r=>{var p,h;return s(u,{className:"p-6",children:[s("div",{className:"flex flex-col items-start justify-between gap-6 md:flex-row",children:[s("div",{className:"flex-1",children:[e("h3",{className:"mb-4 text-lg font-semibold",children:r.class_topic}),s("div",{className:"text-muted-foreground mb-4 space-y-3 text-sm",children:[s("div",{className:"flex items-center gap-2",children:[e(_,{className:"h-4 w-4"}),e("span",{children:f(x(r.class_date_and_time),"PPP")})]}),s("div",{className:"flex items-center gap-2",children:[e(I,{className:"h-4 w-4"}),e("span",{children:f(x(r.class_date_and_time),"p")})]}),s("div",{className:"flex items-center gap-2",children:[e(j,{className:"h-4 w-4"}),s("span",{children:[t.instructor,": ",((h=(p=o.instructor)==null?void 0:p.user)==null?void 0:h.name)||"Unknown"]})]})]})]}),s("div",{className:"flex flex-col gap-2",children:[e(B,{courseId:o.id,liveClass:r,zoomConfig:m}),e(g,{routePath:route("live-class.destroy",r.id),actionComponent:s(c,{size:"sm",variant:"outline",className:"flex w-full items-center gap-1 text-red-600 hover:text-red-700",children:[e(k,{className:"h-3 w-3"}),t.delete_class]})})]})]}),r.class_note&&e(v,{type:"single",collapsible:!0,className:"mt-4 w-full",children:s(b,{value:"item-1",className:"bg-muted overflow-hidden rounded-lg border-none",children:[e(w,{className:"[&[data-state=open]]:!bg-secondary-lighter px-4 py-2 text-base font-medium hover:no-underline",children:t.class_note}),e(y,{className:"p-4",children:e(A,{value:r.class_note})})]})})]},r.id)})})]})})};export{ve as default};
