Perplexica/src/components/Layout.tsx

19 lines
497 B
TypeScript
Raw Normal View History

'use client';
import { useSelectedLayoutSegments } from 'next/navigation';
2024-04-09 16:21:05 +05:30
const Layout = ({ children }: { children: React.ReactNode }) => {
const segments = useSelectedLayoutSegments();
const isDashboard = segments.includes('dashboard');
2024-04-09 16:21:05 +05:30
return (
2024-05-27 11:49:09 +08:00
<main className="lg:pl-20 bg-light-primary dark:bg-dark-primary min-h-screen">
<div className={isDashboard ? "mx-4" : "max-w-screen-lg lg:mx-auto mx-4"}>
{children}
</div>
2024-04-09 16:21:05 +05:30
</main>
);
};
export default Layout;