mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
34 lines
1 KiB
TypeScript
34 lines
1 KiB
TypeScript
'use client';
|
|
import DashLeftMenu from '@components/Dashboard/Menus/DashLeftMenu';
|
|
import DashMobileMenu from '@components/Dashboard/Menus/DashMobileMenu';
|
|
import AdminAuthorization from '@components/Security/AdminAuthorization'
|
|
import { SessionProvider } from 'next-auth/react'
|
|
import React from 'react'
|
|
import { useMediaQuery } from 'usehooks-ts';
|
|
|
|
function ClientAdminLayout({
|
|
children,
|
|
params,
|
|
}: {
|
|
children: React.ReactNode
|
|
params: any
|
|
}) {
|
|
const isMobile = useMediaQuery('(max-width: 768px)')
|
|
|
|
return (
|
|
<SessionProvider>
|
|
<AdminAuthorization authorizationMode="page">
|
|
<div className="flex flex-col md:flex-row">
|
|
{isMobile ? (
|
|
<DashMobileMenu />
|
|
) : (
|
|
<DashLeftMenu />
|
|
)}
|
|
<div className="flex w-full">{children}</div>
|
|
</div>
|
|
</AdminAuthorization>
|
|
</SessionProvider>
|
|
)
|
|
}
|
|
|
|
export default ClientAdminLayout
|