98 lines
3.6 KiB
JavaScript
98 lines
3.6 KiB
JavaScript
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
import { D as DataSortModal } from "./data-sort-modal-DUjsJmGW.js";
|
|
import { S as Switch } from "./switch-ad-BDGs-.js";
|
|
import { B as Button } from "./button-CdJZJLGw.js";
|
|
import { C as Card } from "./card-B-gBwpxd.js";
|
|
import { L as Label } from "./label-0rIIfpX0.js";
|
|
import { L as LandingLayout } from "./landing-layout-Cned6N12.js";
|
|
import { usePage, router } from "@inertiajs/react";
|
|
import { Settings } from "lucide-react";
|
|
import "nprogress";
|
|
import "./utils-DLCPGU0v.js";
|
|
import "clsx";
|
|
import "tailwind-merge";
|
|
import "react";
|
|
import "./dialog-DGP_3dPQ.js";
|
|
import "@radix-ui/react-dialog";
|
|
import "./scroll-area-CDdrLubh.js";
|
|
import "@radix-ui/react-scroll-area";
|
|
import "./switch-CEzDpTwE.js";
|
|
import "@radix-ui/react-switch";
|
|
import "@radix-ui/react-slot";
|
|
import "class-variance-authority";
|
|
import "@radix-ui/react-label";
|
|
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 "./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 "./avatar-C8iCpF5R.js";
|
|
import "@radix-ui/react-avatar";
|
|
import "nanoid";
|
|
const Layout = ({ page: innerPage, navbarHeight = true, children }) => {
|
|
const { props } = usePage();
|
|
const { customize } = props;
|
|
const page = innerPage || props.page;
|
|
const slug = page.slug;
|
|
const customizable = slug === "about-us" || slug === "our-team" || page.type !== "inner_page";
|
|
const sections = page.sections.filter(
|
|
(section) => section.slug !== "footer_list_1" && section.slug !== "footer_list_2" && section.slug !== "footer_list_3"
|
|
);
|
|
const sectionActiveChange = (id, active) => {
|
|
router.post(route("page.section.update", id), {
|
|
active
|
|
});
|
|
};
|
|
return /* @__PURE__ */ jsx(LandingLayout, { navbarHeight, customizable, children: customize ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
customize && page && /* @__PURE__ */ jsx("div", { className: "fixed top-20 right-6 z-20", children: /* @__PURE__ */ jsx(
|
|
DataSortModal,
|
|
{
|
|
title: "Page Sections",
|
|
data: sections,
|
|
handler: /* @__PURE__ */ jsx(Button, { size: "icon", children: /* @__PURE__ */ jsx(Settings, { className: "h-7 w-7" }) }),
|
|
onOrderChange: (newOrder, setOpen) => {
|
|
router.post(
|
|
route("page.section.sort"),
|
|
{
|
|
sortedData: newOrder
|
|
},
|
|
{ preserveScroll: true, onSuccess: () => setOpen && setOpen(false) }
|
|
);
|
|
},
|
|
renderContent: (item) => /* @__PURE__ */ jsxs(Card, { className: "flex w-full items-center justify-between px-4 py-3", children: [
|
|
/* @__PURE__ */ jsx("p", { children: item.name }),
|
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
/* @__PURE__ */ jsx(Label, { htmlFor: "active", children: "Active" }),
|
|
/* @__PURE__ */ jsx(
|
|
Switch,
|
|
{
|
|
id: "active",
|
|
defaultChecked: item.active,
|
|
onCheckedChange: (checked) => sectionActiveChange(item.id, checked)
|
|
}
|
|
)
|
|
] })
|
|
] })
|
|
}
|
|
) }),
|
|
children
|
|
] }) : children });
|
|
};
|
|
export {
|
|
Layout as default
|
|
};
|