// app/admin/layout.js
'use client'
import { useState } from "react"
import RequireAuth from "@/components/RequireAuth"
// import { Sidebar } from "@/components/Dashboard/pharmacy/Sidebar"
import Sidebar from '@/components/Dashboard/common/Sidebar';
import Navbar from "@/components/Dashboard/common/Navbar"

export default function PharmacyLayout({ children }) {
    const [sidebarOpen, setSidebarOpen] = useState(false);

    return (
        <RequireAuth requiredRole="pharmacy">
            <div className="flex h-screen bg-gray-50">
                <Sidebar sidebarOpen={sidebarOpen} setSidebarOpen={setSidebarOpen} role="pharmacy"/>
                <div className="flex flex-col flex-1 overflow-hidden">
                    <Navbar setSidebarOpen={setSidebarOpen} role="pharmacy" />
                    <main className="flex-1 overflow-y-auto p-6">
                        {children}
                    </main>
                </div>
            </div>
        </RequireAuth>
    )
}