From b36eea8c579ed542c88a914d0b44c52e9d92b0f5 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sat, 12 Oct 2024 18:12:32 +0000
Subject: feature(web): Implement a new profile options drop menu and move user
 and admin settings there

---
 apps/web/components/dashboard/header/Header.tsx | 42 +------------------------
 1 file changed, 1 insertion(+), 41 deletions(-)

(limited to 'apps/web/components/dashboard/header/Header.tsx')

diff --git a/apps/web/components/dashboard/header/Header.tsx b/apps/web/components/dashboard/header/Header.tsx
index 11e3b3c3..b145683d 100644
--- a/apps/web/components/dashboard/header/Header.tsx
+++ b/apps/web/components/dashboard/header/Header.tsx
@@ -1,18 +1,10 @@
-import React from "react";
 import Link from "next/link";
 import { redirect } from "next/navigation";
 import GlobalActions from "@/components/dashboard/GlobalActions";
 import ProfileOptions from "@/components/dashboard/header/ProfileOptions";
 import { SearchInput } from "@/components/dashboard/search/SearchInput";
 import HoarderLogo from "@/components/HoarderIcon";
-import { Button } from "@/components/ui/button";
-import {
-  Tooltip,
-  TooltipContent,
-  TooltipTrigger,
-} from "@/components/ui/tooltip";
 import { getServerAuthSession } from "@/server/auth";
-import { Settings, Shield } from "lucide-react";
 
 export default async function Header() {
   const session = await getServerAuthSession();
@@ -20,26 +12,6 @@ export default async function Header() {
     redirect("/");
   }
 
-  const adminItem =
-    session.user.role == "admin"
-      ? [
-          {
-            name: "Admin",
-            icon: <Shield size={18} />,
-            path: "/dashboard/admin",
-          },
-        ]
-      : [];
-
-  const headerItems = [
-    ...adminItem,
-    {
-      name: "Settings",
-      icon: <Settings size={18} />,
-      path: "/dashboard/settings",
-    },
-  ];
-
   return (
     <header className="sticky left-0 right-0 top-0 z-50 flex h-16 items-center justify-between overflow-x-auto overflow-y-hidden bg-background p-4 shadow">
       <div className="hidden items-center sm:flex">
@@ -51,19 +23,7 @@ export default async function Header() {
         <SearchInput className="min-w-40 bg-muted" />
         <GlobalActions />
       </div>
-      <div className="hidden items-center sm:flex">
-        {headerItems.map((item) => (
-          <Tooltip key={item.name} delayDuration={0}>
-            <TooltipTrigger asChild>
-              <Button variant="ghost">
-                <Link href={item.path} className="flex items-center">
-                  {item.icon}
-                </Link>
-              </Button>
-            </TooltipTrigger>
-            <TooltipContent side="bottom">{item.name}</TooltipContent>
-          </Tooltip>
-        ))}
+      <div className="flex items-center">
         <ProfileOptions />
       </div>
     </header>
-- 
cgit v1.2.3-70-g09d2

