21 lines
483 B
TypeScript
21 lines
483 B
TypeScript
"use client";
|
|
|
|
import { usePathname } from "next/navigation";
|
|
import type { ReactNode } from "react";
|
|
import Header from "@/components/Header";
|
|
import Footer from "@/components/Footer";
|
|
|
|
export default function SiteFrame({ children }: { children: ReactNode }) {
|
|
const pathname = usePathname();
|
|
const isAdmin = pathname.startsWith("/admin");
|
|
|
|
if (isAdmin) return <>{children}</>;
|
|
|
|
return (
|
|
<>
|
|
<Header />
|
|
<main>{children}</main>
|
|
<Footer />
|
|
</>
|
|
);
|
|
}
|