'use client'

import { useState } from 'react';

import RequireAuth from "@/components/RequireAuth"
import Navbar from '@/components/Dashboard/common/Navbar';

import Sidebar from '@/components/Dashboard/common/Sidebar';

export default function PatientLayout({ children }) {
    const [sidebarOpen, setSidebarOpen] = useState(false);
    return (
        <RequireAuth requiredRole="patient">
            <div className="flex h-screen bg-gray-50">
                <Sidebar sidebarOpen={sidebarOpen} setSidebarOpen={setSidebarOpen} role="patient" />
                <div className="flex flex-col flex-1 overflow-hidden">
                    <Navbar setSidebarOpen={setSidebarOpen} role="patient" />
                    <main className="flex-1 overflow-y-auto p-6">
                        {children}
                    </main>
                </div>
            </div>
        </RequireAuth>
    )
}