File size: 2,002 Bytes
5649a75
e71a2ef
784b5c6
92f01f5
3acdbcc
5649a75
92f01f5
e71a2ef
2ea6bf5
e71a2ef
 
784b5c6
 
 
 
 
 
 
 
 
3acdbcc
784b5c6
 
 
 
 
e71a2ef
 
3acdbcc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
784b5c6
3acdbcc
 
fced295
3acdbcc
 
 
 
 
 
 
784b5c6
 
3acdbcc
 
e71a2ef
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
'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>
  );
}