import { jsxs, jsx } from "react/jsx-runtime"; import { S as StudentFeedback } from "./student-feedback-uDPyWa7I.js"; import { T as Tabs } from "./tabs-DgXFE6Gu.js"; import { S as Separator } from "./separator-CSqU-rrB.js"; import { T as TabsList, a as TabsTrigger, b as TabsContent } from "./tabs-DmCK9qzK.js"; import { usePage } from "@inertiajs/react"; import { useState, useEffect } from "react"; import { Renderer } from "richtor"; /* empty css */ import ReviewForm from "./review-BzuN0Rri.js"; import Forum from "./forum-BI6IlQJ_.js"; import Resource from "./resource-DAtUA5zx.js"; import "./progress-BDXVqPeB.js"; import "@radix-ui/react-progress"; import "./utils-DLCPGU0v.js"; import "clsx"; import "tailwind-merge"; import "./use-lang-44ndmTOc.js"; import "lucide-react"; import "@radix-ui/react-separator"; import "@radix-ui/react-tabs"; import "./delete-modal-BrX_mlY2.js"; import "./button-CdJZJLGw.js"; import "@radix-ui/react-slot"; import "class-variance-authority"; import "./dialog-DGP_3dPQ.js"; import "@radix-ui/react-dialog"; import "./input-error-D1JIzedA.js"; import "./loading-button-CCIxhJrY.js"; import "./table-footer-BvAwBYor.js"; import "./dropdown-menu-msun3TP8.js"; import "@radix-ui/react-dropdown-menu"; import "./route-DlE7FdTW.js"; import "./scroll-area-CDdrLubh.js"; import "@radix-ui/react-scroll-area"; import "./avatar-C8iCpF5R.js"; import "@radix-ui/react-avatar"; import "./label-0rIIfpX0.js"; import "@radix-ui/react-label"; import "./textarea-Z0d4V-ti.js"; import "date-fns"; import "sonner"; import "./review-edit-D01_qU3v.js"; import "./input-BsvJqbcd.js"; import "./inertia-BtwbgBI3.js"; import "./forum-edit-B5Os53Be.js"; import "./forum-reply-CdUtTLPe.js"; const ContentSummery = () => { const { props } = usePage(); const { translate, type } = props; const { button } = translate; const [isResource, setIsResource] = useState(false); useEffect(() => { if (type === "lesson") { const watching = props.watching; if (watching.resources.length > 0) { setIsResource(true); } } }, [props.watching]); const tabs = [ { value: "summery", label: button.summery }, { value: "resource", label: "Resource" }, { value: "forum", label: button.forum }, { value: "review", label: button.review } ]; return /* @__PURE__ */ jsxs(Tabs, { defaultValue: "summery", className: "mx-auto grid w-full max-w-5xl overflow-hidden rounded-md pt-1 pb-10", children: [ /* @__PURE__ */ jsx("div", { className: "overflow-x-auto overflow-y-hidden", children: /* @__PURE__ */ jsx(TabsList, { className: "bg-transparent px-0 py-6", children: tabs.map(({ label, value }) => { if (value === "resource" && !isResource) { return null; } return /* @__PURE__ */ jsx( TabsTrigger, { value, className: "border-primary data-[state=active]:!bg-muted data-[state=active]:before:bg-primary relative flex cursor-pointer items-center justify-start gap-3 rounded-none bg-transparent px-8 py-4 text-start !shadow-none before:absolute before:right-0 before:bottom-0 before:left-0 before:h-1 before:rounded-t-xl data-[state=active]:before:content-['.']", children: /* @__PURE__ */ jsx("span", { children: label }) }, value ); }) }) }), /* @__PURE__ */ jsx(Separator, { className: "mt-[1px]" }), /* @__PURE__ */ jsx(TabsContent, { value: "summery", className: "m-0 p-5", children: /* @__PURE__ */ jsx(Renderer, { value: props.watching.summary }) }), isResource && /* @__PURE__ */ jsx(TabsContent, { value: "resource", className: "m-0 p-5", children: /* @__PURE__ */ jsx(Resource, {}) }), /* @__PURE__ */ jsx(TabsContent, { value: "forum", className: "m-0 p-5", children: /* @__PURE__ */ jsx(Forum, {}) }), /* @__PURE__ */ jsxs(TabsContent, { value: "review", className: "m-0 space-y-6 p-5", children: [ /* @__PURE__ */ jsx(StudentFeedback, { totalReviews: props.totalReviews }), /* @__PURE__ */ jsx(ReviewForm, {}) ] }) ] }); }; export { ContentSummery as default };