231 lines
9.1 KiB
JavaScript
231 lines
9.1 KiB
JavaScript
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
import { C as Card, a as CardHeader, b as CardContent } from "./card-B-gBwpxd.js";
|
|
import { c as cn } from "./utils-DLCPGU0v.js";
|
|
import { usePage, Link, Head } from "@inertiajs/react";
|
|
import { B as ButtonGradientPrimary } from "./button-gradient-primary-DnxbZRJu.js";
|
|
import { A as Avatar, a as AvatarImage, b as AvatarFallback } from "./avatar-C8iCpF5R.js";
|
|
import { P as Progress } from "./progress-BDXVqPeB.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 Layout from "./layout-4WzWTMAV.js";
|
|
import CourseAssignments from "./course-assignments-BluQzvyW.js";
|
|
import CourseCertificate from "./course-certificate-Qkut3EGo.js";
|
|
import CourseLiveClasses from "./course-live-classes-CUnMWJRb.js";
|
|
import CourseModules from "./course-modules-Cs_II7eD.js";
|
|
import CourseQuizzes from "./course-quizzes-8Fts-_Ks.js";
|
|
import CourseResources from "./course-resources-DwcVHQmG.js";
|
|
import "react";
|
|
import "clsx";
|
|
import "tailwind-merge";
|
|
import "./button-CdJZJLGw.js";
|
|
import "@radix-ui/react-slot";
|
|
import "class-variance-authority";
|
|
import "@radix-ui/react-avatar";
|
|
import "@radix-ui/react-progress";
|
|
import "@radix-ui/react-separator";
|
|
import "@radix-ui/react-tabs";
|
|
import "./scroll-area-CDdrLubh.js";
|
|
import "@radix-ui/react-scroll-area";
|
|
import "./sheet-BOQ-e9_C.js";
|
|
import "@radix-ui/react-dialog";
|
|
import "lucide-react";
|
|
import "./use-screen-B7SDA5zE.js";
|
|
import "./landing-layout-Cned6N12.js";
|
|
import "./index-CzkkaexN.js";
|
|
import "./app-logo-DWyi5bLn.js";
|
|
import "lucide-react/dynamic";
|
|
import "./main-BKBelQb-.js";
|
|
import "next-themes";
|
|
import "sonner";
|
|
import "./dropdown-menu-msun3TP8.js";
|
|
import "@radix-ui/react-dropdown-menu";
|
|
import "./use-auth-8FvJer_G.js";
|
|
import "./appearance-BJIqrZL5.js";
|
|
import "./language-mewnB-2r.js";
|
|
import "./notification-Bg6IzWOo.js";
|
|
import "./popover-Cv6Hz_y0.js";
|
|
import "@radix-ui/react-popover";
|
|
import "date-fns";
|
|
import "./profile-toggle-DX74bufz.js";
|
|
import "nanoid";
|
|
import "./tab-lists-D4kQQDJd.js";
|
|
import "./table-header-CdEXSV6s.js";
|
|
import "./table-BMWNGY4o.js";
|
|
import "@tanstack/react-table";
|
|
import "./assignment-columns-Ca80rBXJ.js";
|
|
import "./badge-J-zeQvMg.js";
|
|
import "./assignment-dialog-DBxMkyQq.js";
|
|
import "./dialog-DGP_3dPQ.js";
|
|
import "./assignment-details-BD_KqM29.js";
|
|
import "richtor";
|
|
/* empty css */
|
|
import "./assignment-submission-D6YS2fsl.js";
|
|
import "./assignment-submission-form-CmfB3_43.js";
|
|
import "./chunked-uploader-input-CZfv7yqS.js";
|
|
import "./input-BsvJqbcd.js";
|
|
import "axios";
|
|
import "./input-error-D1JIzedA.js";
|
|
import "./loading-button-CCIxhJrY.js";
|
|
import "./label-0rIIfpX0.js";
|
|
import "@radix-ui/react-label";
|
|
import "./select-BYx0MCUK.js";
|
|
import "@radix-ui/react-select";
|
|
import "./textarea-Z0d4V-ti.js";
|
|
import "./dynamic-marksheet-CW0c440m.js";
|
|
import "./radio-group-Wf8uu9ZY.js";
|
|
import "@radix-ui/react-radio-group";
|
|
import "jspdf";
|
|
import "./alert-C0mcq2Y_.js";
|
|
import "./live-class-status-jZlTMN-1.js";
|
|
import "./accordion-cIAfVfPq.js";
|
|
import "@radix-ui/react-accordion";
|
|
import "./lesson-BiO_SsbC.js";
|
|
import "./lesson-icons-CrjzYJr0.js";
|
|
import "./quiz-BHrDCaiL.js";
|
|
import "./quiz-status-DDgXl__w.js";
|
|
import "./quiz-result-dialog-BWqvjGrp.js";
|
|
const CourseCard7 = ({ course, watch_history, completion, className }) => {
|
|
const { props } = usePage();
|
|
const { translate } = props;
|
|
const { frontend, button } = translate;
|
|
return /* @__PURE__ */ jsxs(Card, { className: cn("flex flex-col justify-between overflow-hidden !border md:flex-row", className), children: [
|
|
/* @__PURE__ */ jsx(CardHeader, { className: "h-[200px] w-full max-w-[360px] p-0", children: /* @__PURE__ */ jsx(
|
|
"img",
|
|
{
|
|
src: course.thumbnail || "/assets/images/blank-image.jpg",
|
|
alt: course.title,
|
|
className: "h-full w-full object-cover",
|
|
onError: (e) => {
|
|
const target = e.target;
|
|
target.src = "/assets/images/blank-image.jpg";
|
|
}
|
|
}
|
|
) }),
|
|
/* @__PURE__ */ jsxs(CardContent, { className: "flex w-full flex-col justify-between p-4", children: [
|
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
/* @__PURE__ */ jsx("div", { className: "mb-3 flex items-center gap-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
/* @__PURE__ */ jsxs(Avatar, { className: "h-8 w-8", children: [
|
|
/* @__PURE__ */ jsx(AvatarImage, { src: course.instructor.user.photo || "", alt: course.instructor.user.name, className: "object-cover" }),
|
|
/* @__PURE__ */ jsx(AvatarFallback, { children: "IM" })
|
|
] }),
|
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: course.instructor.user.name })
|
|
] }) }),
|
|
/* @__PURE__ */ jsx("p", { className: "hover:text-secondary-foreground text-sm font-semibold", children: course.title })
|
|
] }),
|
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
/* @__PURE__ */ jsxs("div", { className: "w-full space-y-2 pt-4 pb-2", children: [
|
|
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground flex items-center justify-between text-sm font-medium", children: [
|
|
/* @__PURE__ */ jsx("span", { children: frontend.progress }),
|
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
(completion == null ? void 0 : completion.completion) ?? 0,
|
|
"%"
|
|
] })
|
|
] }),
|
|
/* @__PURE__ */ jsx(Progress, { value: Number((completion == null ? void 0 : completion.completion) ?? 0), className: "h-1.5" })
|
|
] }),
|
|
watch_history && /* @__PURE__ */ jsx(
|
|
ButtonGradientPrimary,
|
|
{
|
|
asChild: true,
|
|
shadow: false,
|
|
containerClass: "w-full",
|
|
className: "to-primary-light hover:to-primary-light h-9 w-full",
|
|
children: /* @__PURE__ */ jsx(
|
|
Link,
|
|
{
|
|
href: route("course.player", {
|
|
type: watch_history.current_watching_type,
|
|
watch_history: watch_history.id,
|
|
lesson_id: watch_history.current_watching_id
|
|
}),
|
|
children: button.continue
|
|
}
|
|
)
|
|
}
|
|
)
|
|
] })
|
|
] })
|
|
] });
|
|
};
|
|
const Course = (props) => {
|
|
const { tab, course, watchHistory, completion } = props;
|
|
const tabs = [
|
|
{
|
|
value: "modules",
|
|
label: "Modules"
|
|
},
|
|
{
|
|
value: "live_classes",
|
|
label: "Live Classes"
|
|
},
|
|
{
|
|
value: "assignments",
|
|
label: "Assignments"
|
|
},
|
|
{
|
|
value: "quizzes",
|
|
label: "Quizzes"
|
|
},
|
|
{
|
|
value: "resources",
|
|
label: "Resources"
|
|
},
|
|
{
|
|
value: "certificate",
|
|
label: "Certificate"
|
|
}
|
|
];
|
|
const renderContent = () => {
|
|
switch (tab) {
|
|
case "modules":
|
|
return /* @__PURE__ */ jsx(CourseModules, {});
|
|
case "live_classes":
|
|
return /* @__PURE__ */ jsx(CourseLiveClasses, {});
|
|
case "assignments":
|
|
return /* @__PURE__ */ jsx(CourseAssignments, {});
|
|
case "quizzes":
|
|
return /* @__PURE__ */ jsx(CourseQuizzes, {});
|
|
case "resources":
|
|
return /* @__PURE__ */ jsx(CourseResources, {});
|
|
case "certificate":
|
|
return /* @__PURE__ */ jsx(CourseCertificate, {});
|
|
default:
|
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
}
|
|
};
|
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
/* @__PURE__ */ jsx(Head, { title: course.title }),
|
|
/* @__PURE__ */ jsx(CourseCard7, { course, watch_history: watchHistory, completion }),
|
|
/* @__PURE__ */ jsx(Card, { className: "mt-6", children: /* @__PURE__ */ jsxs(Tabs, { value: tab, className: "bg-card w-full overflow-hidden rounded-md", 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 }) => {
|
|
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-['.']",
|
|
asChild: true,
|
|
children: /* @__PURE__ */ jsx(
|
|
Link,
|
|
{
|
|
href: route("student.course.show", {
|
|
id: course.id,
|
|
tab: value
|
|
}),
|
|
children: /* @__PURE__ */ jsx("span", { children: label })
|
|
}
|
|
)
|
|
},
|
|
value
|
|
);
|
|
}) }) }),
|
|
/* @__PURE__ */ jsx(Separator, { className: "mt-[1px]" }),
|
|
/* @__PURE__ */ jsx(TabsContent, { value: tab, className: "m-0 p-5", children: renderContent() })
|
|
] }) })
|
|
] });
|
|
};
|
|
Course.layout = (page) => /* @__PURE__ */ jsx(Layout, { children: page, tab: "courses" });
|
|
export {
|
|
Course as default
|
|
};
|