2 lines
5.7 KiB
JavaScript
2 lines
5.7 KiB
JavaScript
import{u as g,j as e,e as l,ap as f,bn as N,c1 as c,T as m,cc as b}from"./vendor-BKmmeuxg.js";import{D as p}from"./data-sort-modal-B2Yf_crJ.js";import{D as n}from"./delete-modal-D1GJlb1P.js";import{A as w,a as y,b as _,c as C}from"./accordion-CNBvFN43.js";import{B as t}from"./button-BpNwv2aE.js";import{C as d}from"./card-D9_SJYq6.js";import{P,a as z,b as S}from"./popover-B4kBsMuI.js";import{S as D}from"./separator-_3LZ_wAA.js";import h from"./lesson-form-DfMfPQi9.js";import A from"./question-questions-CMWOHq7s.js";import x from"./quiz-form-OtDh--1c.js";import u from"./section-form-DH_DllvQ.js";import I from"./resource-modal-CnHntnj1.js";import"./utils-DxSsnXxD.js";import"./dialog-B2gN9MvT.js";import"./scroll-area-C8HGru-R.js";import"./index-WW_1X1qx.js";import"./chunked-uploader-input-D0XPVOTS.js";import"./input-DM0goJrn.js";import"./index-D9-QKOod.js";import"./input-error-LaPr_4wd.js";import"./loading-button-BnTVAMJ7.js";import"./tabs-D0Mbb5M5.js";import"./tabs-Ifouhv9A.js";import"./label-HmIcv5Yx.js";import"./radio-group-C0C2vfl-.js";import"./select-CD9o3HN1.js";import"./textarea-CyndvowL.js";import"./file-metadata-CAFSN-Sn.js";import"./inertia-SZXqLvQm.js";import"./richtor-CRcM6Du2.js";import"./question-form-BYtkaE3L.js";import"./tag-input-BqUWHOBp.js";import"./resource-form-BCcyGRWo.js";import"./resource-list-DcxkTnJF.js";const he=()=>{const{props:i}=g(),{translate:j}=i,{button:o,dashboard:a}=j;return e.jsxs(d,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[e.jsx(u,{title:o.add_section,handler:e.jsx(t,{variant:"ghost",className:"bg-muted hover:bg-muted-foreground/10",children:o.add_section})}),e.jsx(p,{title:o.sort,data:i.course.sections,handler:e.jsx(t,{variant:"ghost",className:"bg-muted hover:bg-muted-foreground/10",children:o.sort_section}),onOrderChange:s=>{l.post(route("section.sort"),{sortedData:s},{preserveScroll:!0})},renderContent:s=>e.jsx(d,{className:"w-full px-4 py-3",children:e.jsx("p",{children:s.title})})})]}),e.jsx(D,{className:"my-6"}),e.jsx(w,{type:"single",collapsible:!0,className:"space-y-4",children:i.course.sections.map((s,v)=>e.jsxs(y,{value:s.id,className:"w-full overflow-hidden rounded-lg border",children:[e.jsx(_,{className:"[&[data-state=open]]:bg-muted px-4 py-3 text-base hover:no-underline",children:e.jsxs("div",{className:"flex w-full items-center justify-between pr-4",children:[e.jsxs("span",{children:[v+1,". ",s.title]}),e.jsx("div",{onClick:r=>r.stopPropagation(),children:e.jsxs(P,{children:[e.jsx(z,{children:e.jsxs(t,{variant:"ghost",className:"bg-muted hover:bg-muted-foreground/10 px-2.5",children:[e.jsx("span",{children:"Section Menu"}),e.jsx(f,{className:"h-4 w-4"})]})}),e.jsxs(S,{align:"end",className:"flex w-[160px] flex-col space-y-1 p-2",children:[e.jsx(h,{title:o.add_lesson,sectionId:s.id,handler:e.jsx(t,{variant:"ghost",className:"bg-muted hover:bg-muted-foreground/10 h-8 w-full",children:e.jsx("span",{children:o.add_lesson})})}),e.jsx(p,{title:a.sort_items,data:s.section_lessons,handler:e.jsx(t,{variant:"ghost",className:"bg-muted hover:bg-muted-foreground/10 h-8 w-full",children:e.jsx("span",{children:"Sort Lessons"})}),onOrderChange:r=>{l.post(route("lesson.sort"),{sortedData:r},{preserveScroll:!0})},renderContent:r=>e.jsx(d,{className:"w-full px-4 py-3",children:e.jsx("p",{children:r.title})})}),e.jsx(x,{title:o.add_quiz,sectionId:s.id,handler:e.jsx(t,{variant:"ghost",className:"bg-muted hover:bg-muted-foreground/10 h-8 w-full",children:e.jsx("span",{children:o.add_quiz})})}),e.jsx(u,{title:a.update_section,section:s,handler:e.jsx(t,{variant:"secondary",className:"h-8 w-full",children:e.jsx("span",{children:a.update_section})})}),e.jsx(n,{routePath:route("section.delete",{id:s.id}),actionComponent:e.jsx(t,{variant:"ghost",className:"bg-destructive/8 hover:bg-destructive/6 text-destructive hover:text-destructive h-8 w-full",children:o.delete_section})})]})]})})]})}),e.jsxs(C,{className:"space-y-4 p-4",children:[s.section_lessons.length>0?s.section_lessons.map(r=>e.jsxs("div",{className:"group border-border flex w-full items-center justify-between rounded-md border px-4 py-3",children:[e.jsx("p",{children:r.title}),e.jsxs("div",{className:"invisible flex items-center gap-2 group-hover:visible",children:[e.jsx(I,{lesson:r,title:"Lesson Resources",handler:e.jsxs(t,{variant:"secondary",className:"h-7 px-2",children:[e.jsx(N,{className:"h-3 w-3"})," ",e.jsx("span",{children:"Resource"})]})}),e.jsx(h,{lesson:r,sectionId:s.id,title:a.update_lesson,handler:e.jsx(t,{size:"icon",variant:"secondary",className:"h-7 w-7",children:e.jsx(c,{className:"h-3 w-3"})})}),e.jsx(n,{routePath:route("lesson.delete",{id:r.id}),actionComponent:e.jsx(t,{size:"icon",variant:"secondary",className:"text-destructive h-7 w-7",children:e.jsx(m,{className:"h-3 w-3"})})})]})]},r.id)):e.jsx("div",{className:"text-muted-foreground py-4 text-center text-sm",children:"No lessons found in this section."}),s.section_quizzes.map(r=>e.jsxs("div",{className:"group border-border flex w-full items-center justify-between rounded-md border px-4 py-3",children:[e.jsx("p",{children:r.title}),e.jsxs("div",{className:"invisible flex items-center gap-2 group-hover:visible",children:[e.jsx(A,{quiz:r,title:o.quiz_questions,handler:e.jsx(t,{size:"icon",variant:"secondary",className:"h-7 w-7",children:e.jsx(b,{className:"h-3 w-3"})})}),e.jsx(n,{routePath:route("quiz.delete",{id:r.id}),actionComponent:e.jsx(t,{size:"icon",variant:"secondary",className:"text-destructive h-7 w-7",children:e.jsx(m,{className:"h-3 w-3"})})}),e.jsx(x,{quiz:r,title:a.update_quiz,sectionId:s.id,handler:e.jsx(t,{size:"icon",variant:"secondary",className:"h-7 w-7",children:e.jsx(c,{className:"h-3 w-3"})})})]})]},r.id))]})]},s.id))})]})};export{he as default};
|