Web.Auth.Nexus / frontend /app /layout.js
ChandimaPrabath's picture
v0.0.3 Debug
fced295
raw
history blame
2.05 kB
'use client';
import "./globals.css";
import { useState } from "react";
import { NexusAuthWrapper } from "@/app/components/NexusAuth";
import { ToastContainer, Flip } from 'react-toastify';
import { CheckCircleIcon, InformationCircleIcon, ExclamationCircleIcon } from '@heroicons/react/20/solid';
import Sidebar from "@/app/components/Sidebar";
import { ToastProvider } from "@/app/lib/ToastContext"; // Update with your file path
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>
);
}