import {ReactNode} from 'react' import {merge} from '@/lib/utils' import {redirect} from 'next/navigation' import {getProfile} from '@/actions/auth/auth' import Header from './_client/header' import Navbar from '@/app/admin/_client/navbar' export type DashboardLayoutProps = { children: ReactNode } export default async function DashboardLayout(props: DashboardLayoutProps) { // ====================== // profile // ====================== const user = await getProfile() if (!user) { return redirect(`/login?redirect=${encodeURIComponent('/admin')}`) } // ====================== // render // ====================== return (
{props.children}
) }