aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web/app/dashboard/components/Sidebar.tsx
blob: d2ec14a630d4a04d4590b50c2db8fadbc750c48e (plain) (blame)
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
import { Button } from "@/components/ui/button";
import {
  Archive,
  MoreHorizontal,
  Star,
  Tag,
  Home,
  Brain,
  Settings,
} from "lucide-react";
import { redirect } from "next/navigation";
import SidebarItem from "./SidebarItem";
import { getServerAuthSession } from "@/server/auth";

export default async function Sidebar() {
  const session = await getServerAuthSession();
  if (!session) {
    redirect("/");
  }

  return (
    <aside className="flex h-full w-60 flex-col border-r p-4">
      <div className="mb-5 flex items-center rounded-lg px-1 text-slate-900">
        <Brain />
        <span className="ml-2 text-base font-semibold">Remember</span>
      </div>
      <hr />
      <div>
        <ul className="mt-5 space-y-2 text-sm font-medium">
          <SidebarItem
            logo={<Home />}
            name="Home"
            path="/dashboard/bookmarks"
          />
          <SidebarItem
            logo={<Star />}
            name="Favourites"
            path="/dashboard/bookmarks/favourites"
          />
          <SidebarItem
            logo={<Archive />}
            name="Archive"
            path="/dashboard/bookmarks/archive"
          />
          <SidebarItem logo={<Tag />} name="Tags" path="#" />
          <SidebarItem
            logo={<Settings />}
            name="Settings"
            path="/dashboard/settings"
          />
        </ul>
      </div>
      <div className="mt-auto flex justify-between">
        <div className="my-auto"> {session.user.name} </div>
        <Button variant="ghost" className="h-10">
          <MoreHorizontal />
        </Button>
      </div>
    </aside>
  );
}