import { cn } from '@/shared/lib/utils'
import React from 'react'
import { DashboardHeader, type DashboardHeaderProps } from './dashboard-header'

type DashboardPageProps = {
    children: React.ReactNode
    header?: React.ReactNode | null
    headerProps?: DashboardHeaderProps
     fullscreen?: boolean
}

export default function DashboardPage({ children, header, headerProps, fullscreen,   }: DashboardPageProps) {
    const resolvedHeader = header !== undefined
        ? header
        : <DashboardHeader {...headerProps} />

    return (
        <div className={cn("flex flex-col gap-4", fullscreen && "gap-0")}>
            {resolvedHeader !== null && (
                <header>
                    {resolvedHeader}
                </header>
            )}
            <main  >
                <div className={cn(fullscreen ? "w-full px-0" : "p-4")}>
                    {children}
                </div>
            </main>
        </div>
    )
}
