From edf8455ebcff6fc73d7127424319e7057be1a1d9 Mon Sep 17 00:00:00 2001 From: ankitatjosh Date: Tue, 1 Oct 2024 17:55:48 +0530 Subject: [PATCH] conditional btns in nav bar --- app/src/components/Header.tsx | 45 +++++++++++++++-------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/app/src/components/Header.tsx b/app/src/components/Header.tsx index 19a79c6..bf4fa59 100644 --- a/app/src/components/Header.tsx +++ b/app/src/components/Header.tsx @@ -1,11 +1,12 @@ +"use client"; import { primaryFont } from "@/fonts"; import { cn } from "@/lib/utils"; -import { FileIcon } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; -import { Button, buttonVariants } from "./ui/button"; +import { usePathname } from "next/navigation"; const Header = () => { + const pathName = usePathname(); return (
{ />
- - Take A Demo - - - View Records - - + {pathName !== "/" && pathName !== "/new" && ( + + Take A Demo + + )} + {pathName !== "/" && pathName !== "/transcriptions" && ( + + View Records + + )}
- ); };