File size: 1,411 Bytes
fdaf912
 
 
 
b7917d5
fdaf912
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b7917d5
fdaf912
b7917d5
fdaf912
 
b7917d5
fdaf912
 
 
 
b7917d5
fdaf912
 
 
 
 
 
 
 
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
// admin-section.tsx
"use client";

import { useState } from "react";
import { AdminMenu, AdminManageRequests, AdminManageCollections, AdminManageUsers } from "@/app/components/ui/admin";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";

const AdminSection: React.FC = () => {
  const [showNewRequest, setShowNewRequest] = useState<boolean>(true);
  const [showUsers, setShowUsers] = useState<boolean>(false);
  const [showCollections, setShowCollections] = useState<boolean>(false);

  return (
    <div className="max-w-5xl w-full rounded-xl bg-white dark:bg-zinc-700/30 dark:from-inherit shadow-xl space-y-4 px-4 pb-4 pt-4">
      {/* Toast Container */}
      <ToastContainer />

      {/* Menu Section */}
      <AdminMenu
        showUsers={showUsers}
        setShowUsers={setShowUsers}
        showNewRequest={showNewRequest}
        setShowNewRequest={setShowNewRequest}
        showCollections={showCollections}
        setShowCollections={setShowCollections}
      />

      {/* Manage Requests Section */}
      {showNewRequest ? (
        <AdminManageRequests />
      ) : null}

      {/* Manage Collections Section */}
      {showCollections ? (
        <AdminManageCollections />
      ) : null}

      {/* Manage Users Section */}
      {showUsers ? (
        <AdminManageUsers />
      ) : null}
    </div>
  );
};

export default AdminSection;