init project portal web
This commit is contained in:
38
components/layout/main-layout/index.tsx
Normal file
38
components/layout/main-layout/index.tsx
Normal file
@ -0,0 +1,38 @@
|
||||
"use client"
|
||||
|
||||
import AppBar from "@/components/module/app-bar"
|
||||
import { SidebarProvider } from "@/components/ui/sidebar"
|
||||
import PricePlanSidebar from "@/lib/price-plan/view/sidebar"
|
||||
import { usePathname } from "next/navigation"
|
||||
import React from "react"
|
||||
import { Toaster } from "sonner"
|
||||
|
||||
interface Props {
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
const MainLayout = ({
|
||||
children
|
||||
}: Props) => {
|
||||
const pathname = usePathname()
|
||||
const match = pathname.match(/\/price-plan\/(\d+)/)
|
||||
|
||||
return (
|
||||
<SidebarProvider>
|
||||
{!match && <PricePlanSidebar />}
|
||||
<section className="w-full">
|
||||
<AppBar useLogo={false} />
|
||||
<main className="py-4">
|
||||
{children}
|
||||
</main>
|
||||
</section>
|
||||
<Toaster
|
||||
richColors
|
||||
position="top-right"
|
||||
duration={1500}
|
||||
/>
|
||||
</SidebarProvider>
|
||||
)
|
||||
}
|
||||
|
||||
export default MainLayout
|
||||
Reference in New Issue
Block a user