lms/bootstrap/ssr/assets/index-nAbOkRjc.js
2025-12-15 12:26:23 +01:00

129 lines
6.2 KiB
JavaScript

import { jsxs, jsx } from "react/jsx-runtime";
import { C as CourseCard1 } from "./course-card-1-DJ2E5bnr.js";
import { R as RatingStars } from "./rating-stars-BSwu6ht6.js";
import { A as Avatar, a as AvatarImage, b as AvatarFallback } from "./avatar-C8iCpF5R.js";
import { B as Button } from "./button-CdJZJLGw.js";
import { T as TooltipProvider, a as Tooltip, b as TooltipTrigger, c as TooltipContent } from "./tooltip-BYKuzaoQ.js";
import { L as LandingLayout } from "./landing-layout-Cned6N12.js";
import { g as getQueryParams } from "./route-DlE7FdTW.js";
import { usePage, Head, router } from "@inertiajs/react";
import { Users, Book, Star, Grid, List } from "lucide-react";
import "./card-B-gBwpxd.js";
import "react";
import "./utils-DLCPGU0v.js";
import "clsx";
import "tailwind-merge";
import "@radix-ui/react-avatar";
import "@radix-ui/react-slot";
import "class-variance-authority";
import "@radix-ui/react-tooltip";
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 "./scroll-area-CDdrLubh.js";
import "@radix-ui/react-scroll-area";
import "./use-auth-8FvJer_G.js";
import "./use-screen-B7SDA5zE.js";
import "./appearance-BJIqrZL5.js";
import "./language-mewnB-2r.js";
import "./separator-CSqU-rrB.js";
import "@radix-ui/react-separator";
import "./notification-Bg6IzWOo.js";
import "./popover-Cv6Hz_y0.js";
import "@radix-ui/react-popover";
import "date-fns";
import "./profile-toggle-DX74bufz.js";
import "nanoid";
const Index = (props) => {
const { instructor, translate } = props;
const { frontend, common } = translate;
const { url } = usePage();
const urlParams = getQueryParams(url);
const viewType = urlParams["view"] ?? "grid";
const { id, user, courses, total_reviews_count, total_average_rating, total_enrollments_count } = instructor;
return /* @__PURE__ */ jsxs("div", { className: "container space-y-10 py-10 md:py-16", children: [
/* @__PURE__ */ jsx(Head, { title: `${user.name} - ${frontend.instructor_profile}` }),
/* @__PURE__ */ jsxs("div", { children: [
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
/* @__PURE__ */ jsxs(Avatar, { className: "h-12 w-12", children: [
/* @__PURE__ */ jsx(AvatarImage, { src: user.photo || "", alt: user.name, className: "object-cover" }),
/* @__PURE__ */ jsx(AvatarFallback, { children: user.name.charAt(0) })
] }),
/* @__PURE__ */ jsxs("div", { className: "group", children: [
/* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold", children: user.name }),
/* @__PURE__ */ jsx("p", { className: "text-gray-500", children: user.email })
] }),
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-1", children: [
/* @__PURE__ */ jsx("span", { className: "text-xl font-semibold", children: total_average_rating ? Number(total_average_rating).toFixed(1) : 0 }),
/* @__PURE__ */ jsx(RatingStars, { rating: total_average_rating || 0, starClass: "h-4 w-4" })
] })
] }),
/* @__PURE__ */ jsxs("div", { className: "mt-6 flex gap-8", children: [
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
/* @__PURE__ */ jsx(Users, { className: "h-5 w-5 text-gray-500" }),
/* @__PURE__ */ jsxs("span", { children: [
total_enrollments_count,
" ",
common.students
] })
] }),
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
/* @__PURE__ */ jsx(Book, { className: "h-5 w-5 text-gray-500" }),
/* @__PURE__ */ jsxs("span", { children: [
courses.length,
" ",
common.courses
] })
] }),
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
/* @__PURE__ */ jsx(Star, { className: "h-5 w-5 text-gray-500" }),
/* @__PURE__ */ jsxs("span", { children: [
total_reviews_count,
" ",
common.reviews
] })
] })
] })
] }),
/* @__PURE__ */ jsxs("div", { className: "mb-4 flex items-center justify-between", children: [
/* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: frontend.all_courses }),
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
/* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
Button,
{
size: "icon",
variant: viewType === "grid" ? "default" : "outline",
onClick: () => router.get(route("instructors.show", { instructor: id, view: "grid" })),
children: /* @__PURE__ */ jsx(Grid, { className: "h-4 w-4" })
}
) }),
/* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: frontend.grid_view }) })
] }) }),
/* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
Button,
{
size: "icon",
variant: viewType === "list" ? "default" : "outline",
onClick: () => router.get(route("instructors.show", { instructor: id, view: "list" })),
children: /* @__PURE__ */ jsx(List, { className: "h-4 w-4" })
}
) }),
/* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: frontend.list_view }) })
] }) })
] })
] }),
/* @__PURE__ */ jsx("div", { className: viewType === "grid" ? "grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3" : "space-y-7", children: courses.map((course) => /* @__PURE__ */ jsx(CourseCard1, { course, viewType }, course.id)) })
] });
};
Index.layout = (page) => /* @__PURE__ */ jsx(LandingLayout, { children: page, customizable: false });
export {
Index as default
};