{"version":3,"file":"CentralMainLayout-Hjg4W471.js","sources":["../../../resources/js/Layouts/CentralMainLayout.jsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { Menu, Popover, Transition } from \"@headlessui/react\";\nimport { ChevronDownIcon } from \"@heroicons/react/24/solid\";\nimport { Bars3Icon, XMarkIcon } from \"@heroicons/react/24/outline\";\nimport Footer from \"./Components/Footer\";\nimport ApplicationLogo from \"@/Components/ApplicationLogo\";\nimport { usePage } from \"@inertiajs/react\";\nimport Link from \"@/Components/BaseLink\";\nimport MainHeader from \"./Components/MainHeader\";\nimport Container from \"@/Components/Container\";\nimport FlashToast from \"@/Components/FlashToast\";\n\nconst userNavigation = [\n { name: \"Your Profile\", href: route(\"my_account.index\") },\n { name: \"Help\", href: \"https://docs.myswimmingclub.uk/\", external: true },\n { name: \"Sign out\", href: route(\"logout\"), method: \"post\" },\n];\n\nfunction classNames(...classes) {\n return classes.filter(Boolean).join(\" \");\n}\n\nconst CentralMainLayout = ({ title, subtitle, children }) => {\n const userObject = usePage().props.auth.user;\n\n const navigation = usePage().props.central.menu;\n\n const user = userObject\n ? {\n name: `${userObject.first_name} ${userObject.last_name}`,\n email: userObject.EmailAddress,\n imageUrl: userObject.gravatar_url,\n }\n : null;\n\n return (\n <>\n {/*\n This example requires updating your template:\n\n ```\n \n \n ```\n */}\n
\n
\n \n \n
\n
\n \n \n \n
\n \n {navigation.map((item) => {\n if (item.external) {\n return (\n \n {item.name}\n \n );\n }\n if (item.children?.length > 0) {\n return (\n // \n // {item.name}\n // \n\n \n
\n \n \n Open {item.name}{\" \"}\n menu\n \n {item.name}{\" \"}\n \n \n
\n \n \n {item.children.map(\n (item) => (\n \n {({\n active,\n }) => (\n \n {\n item.name\n }\n \n )}\n \n ),\n )}\n \n \n \n );\n }\n return (\n \n {item.name}\n \n );\n })}\n \n
\n {/*
\n
\n \n
\n
\n \n
\n \n
\n
\n
*/}\n
\n {/* Mobile menu button */}\n \n \n Open main menu\n \n \n \n
\n \n
\n \n \n \n\n \n \n
\n
\n
\n
\n
\n \n
\n
\n \n \n Close\n menu\n \n \n \n
\n
\n
\n {navigation.map(\n (item) => {\n if (\n item\n .children\n ?.length >\n 0\n ) {\n return (\n // \n // {item.name}\n // \n\n \n \n \n Open{\" \"}\n {\n item.name\n }{\" \"}\n menu\n \n {\n item.name\n }{\" \"}\n \n \n \n \n {item.children.map(\n (\n item,\n ) => (\n \n {({\n active,\n }) => (\n \n {\n item.name\n }\n \n )}\n \n ),\n )}\n \n \n \n );\n }\n return (\n \n {\n item.name\n }\n \n );\n },\n )}\n
\n
\n {user && (\n
\n
\n
\n \n
\n
\n
\n {\n user.name\n }\n
\n
\n {\n user.email\n }\n
\n
\n {/* We don't have notifications yet */}\n {/* \n \n View\n notifications\n \n \n */}\n
\n
\n {userNavigation.map(\n (\n item,\n idx,\n ) => (\n \n {\n item.name\n }\n \n ),\n )}\n
\n
\n )}\n
\n
\n \n \n
\n
\n
\n {/* We don't have notifications yet */}\n {/* \n \n View notifications\n \n \n */}\n\n {/* Profile dropdown */}\n {user && (\n \n
\n \n \n Open user menu\n \n \n \n
\n \n \n {userNavigation.map((item) => (\n \n {({ active }) => (\n \n {item.name}\n \n )}\n \n ))}\n \n \n \n )}\n
\n
\n
\n
\n\n
\n {/* Page header */}\n \n \n \n\n {children}\n
\n
\n\n \n\n