aboutsummaryrefslogtreecommitdiff
path: root/apps/web/app/(dash)/header/newChatButton.tsx
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-06-29 02:10:13 -0500
committerDhravya <[email protected]>2024-06-29 02:10:13 -0500
commit9272d87e5f46aeaf1aea0927d47cf3dd69507867 (patch)
tree063812c491ff5a898e6e15d271e11bf61d1d134c /apps/web/app/(dash)/header/newChatButton.tsx
parentfix: Spaces filter not working (diff)
downloadsupermemory-9272d87e5f46aeaf1aea0927d47cf3dd69507867.tar.xz
supermemory-9272d87e5f46aeaf1aea0927d47cf3dd69507867.zip
fixed new chat button showing up on all pages
Diffstat (limited to 'apps/web/app/(dash)/header/newChatButton.tsx')
-rw-r--r--apps/web/app/(dash)/header/newChatButton.tsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/web/app/(dash)/header/newChatButton.tsx b/apps/web/app/(dash)/header/newChatButton.tsx
new file mode 100644
index 00000000..0e9e1c5a
--- /dev/null
+++ b/apps/web/app/(dash)/header/newChatButton.tsx
@@ -0,0 +1,27 @@
+"use client";
+
+import { ChatIcon } from "@repo/ui/icons";
+import Image from "next/image";
+import Link from "next/link";
+import { usePathname } from "next/navigation";
+import React from "react";
+
+function NewChatButton() {
+ const path = usePathname();
+
+ if (path.startsWith("/chat")) {
+ return (
+ <Link
+ href="/home"
+ className="flex duration-200 items-center text-[#7D8994] hover:bg-[#1F2429] text-[13px] gap-2 px-3 py-2 rounded-xl"
+ >
+ <Image src={ChatIcon} alt="Chat icon" className="w-5" />
+ Start new chat
+ </Link>
+ );
+ }
+
+ return null;
+}
+
+export default NewChatButton;