Spaces:
Sleeping
Sleeping
| 'use client'; | |
| import "./globals.css"; | |
| import { useState } from "react"; | |
| import { NexusAuthWrapper } from "@components/NexusAuth"; | |
| import { ToastContainer, Flip } from 'react-toastify'; | |
| import { CheckCircleIcon, InformationCircleIcon, ExclamationCircleIcon } from '@heroicons/react/20/solid'; | |
| import Sidebar from "@components/Sidebar"; | |
| import { ToastProvider } from "@lib/ToastContext"; | |
| export default function RootLayout({ children }) { | |
| const contentStyle = { | |
| padding: "30px", | |
| flexGrow: 1, | |
| height: "100vh", | |
| overflowY: "auto", | |
| backgroundColor: "var(--background)", | |
| transition: "margin-left 0.3s ease", | |
| }; | |
| const headerStyle = { | |
| marginBottom: "30px", | |
| display: "flex", | |
| justifyContent: "center", | |
| }; | |
| return ( | |
| <html lang="en"> | |
| <body> | |
| <ToastProvider> | |
| <ToastContainer | |
| transition={Flip} | |
| theme="dark" | |
| icon={({ type, theme }) => { | |
| switch (type) { | |
| case 'info': | |
| return <InformationCircleIcon className="text-indigo-400" />; | |
| case 'error': | |
| return <InformationCircleIcon className="text-red-500" />; | |
| case 'success': | |
| return <CheckCircleIcon className="h-5 w-5 text-green-500" />; | |
| case 'warning': | |
| return <ExclamationCircleIcon className="text-yellow-500" />; | |
| default: | |
| return null; | |
| } | |
| }} | |
| /> | |
| <NexusAuthWrapper> | |
| <div className="dashboard-container"> | |
| <Sidebar/> | |
| <div style={contentStyle}> | |
| <header style={headerStyle}> | |
| <h1>Welcome to Nexus Dashboard</h1> | |
| </header> | |
| <div className="main-content"> | |
| {children} | |
| </div> | |
| </div> | |
| </div> | |
| </NexusAuthWrapper> | |
| </ToastProvider> | |
| </body> | |
| </html> | |
| ); | |
| } | |