aboutsummaryrefslogtreecommitdiff
path: root/apps/web/app/(dash)/header
diff options
context:
space:
mode:
authorDhravya Shah <[email protected]>2024-07-25 10:00:52 -0500
committerGitHub <[email protected]>2024-07-25 10:00:52 -0500
commita7e46750515cbf33edeff3acacdbfb65db30a6c5 (patch)
tree0c2f5c28b6ca3f85392c396c73861ac8c8cdc0d1 /apps/web/app/(dash)/header
parenttabs lol (diff)
parentMerge pull request #159 from aryasaatvik/docs (diff)
downloadsupermemory-a7e46750515cbf33edeff3acacdbfb65db30a6c5.tar.xz
supermemory-a7e46750515cbf33edeff3acacdbfb65db30a6c5.zip
Merge branch 'main' into signout
Diffstat (limited to 'apps/web/app/(dash)/header')
-rw-r--r--apps/web/app/(dash)/header/header.tsx32
1 files changed, 19 insertions, 13 deletions
diff --git a/apps/web/app/(dash)/header/header.tsx b/apps/web/app/(dash)/header/header.tsx
index a3fba9b1..595666b0 100644
--- a/apps/web/app/(dash)/header/header.tsx
+++ b/apps/web/app/(dash)/header/header.tsx
@@ -7,6 +7,8 @@ import { getChatHistory } from "../../actions/fetchers";
import NewChatButton from "./newChatButton";
import AutoBreadCrumbs from "./autoBreadCrumbs";
import SignOutButton from "./signOutButton";
+import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@repo/ui/shadcn/dropdown-menu";
+import { CaretDownIcon } from "@radix-ui/react-icons";
async function Header() {
const chatThreads = await getChatHistory();
@@ -33,27 +35,31 @@ async function Header() {
<div className="flex items-center gap-2">
<NewChatButton />
- <div className="relative group">
- <button className="flex duration-200 items-center text-[#7D8994] hover:bg-[#1F2429] text-[13px] gap-2 px-3 py-2 rounded-xl">
- History
- </button>
-
- <div className="absolute p-4 hidden group-hover:block right-0 w-full md:w-[400px] max-h-[70vh] overflow-auto">
- <div className="bg-[#1F2429] rounded-xl p-2 flex flex-col shadow-lg">
- {chatThreads.data.map((thread) => (
+ <DropdownMenu>
+ <DropdownMenuTrigger className="inline-flex flex-row flex-nowrap items-center text-muted-foreground hover:text-foreground">
+ History
+ <CaretDownIcon />
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="p-4 w-full md:w-[400px] max-h-[70vh] overflow-auto border-none">
+ {chatThreads.data.map((thread) => (
+ <DropdownMenuItem asChild>
<Link
prefetch={false}
href={`/chat/${thread.id}`}
key={thread.id}
- className="p-2 rounded-md hover:bg-secondary"
+ className="p-2 rounded-md cursor-pointer focus:bg-secondary focus:text-current"
>
{thread.firstMessage}
</Link>
- ))}
- </div>
- </div>
- </div>
+ </DropdownMenuItem>
+ ))}
+ </DropdownMenuContent>
+ </DropdownMenu>
+
<SignOutButton />
+ </div>
+
+
</div>
</div>
</div>