feat(web): add dashboard layout with sidebar and header

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Consultoria AS
2026-01-22 02:25:35 +00:00
parent 9d49f8a833
commit 06e9f3eba7
4 changed files with 187 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
'use client';
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuthStore } from '@/stores/auth-store';
import { Sidebar } from '@/components/layouts/sidebar';
export default function DashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
const router = useRouter();
const { isAuthenticated } = useAuthStore();
useEffect(() => {
if (!isAuthenticated) {
router.push('/login');
}
}, [isAuthenticated, router]);
if (!isAuthenticated) {
return null;
}
return (
<div className="min-h-screen bg-background">
<Sidebar />
<div className="pl-64">
{children}
</div>
</div>
);
}