From b3a81c3772a48981a66ca5bf80c6f31d07d82f47 Mon Sep 17 00:00:00 2001 From: Waris Date: Tue, 5 Nov 2024 09:41:10 +0530 Subject: [PATCH] feat: added go to buttons to home page --- .../app/home/_components/GoToPageButton.tsx | 50 +++++++++++++++++++ src/app/app/home/page.tsx | 7 +++ 2 files changed, 57 insertions(+) create mode 100644 src/app/app/home/_components/GoToPageButton.tsx diff --git a/src/app/app/home/_components/GoToPageButton.tsx b/src/app/app/home/_components/GoToPageButton.tsx new file mode 100644 index 0000000..647171b --- /dev/null +++ b/src/app/app/home/_components/GoToPageButton.tsx @@ -0,0 +1,50 @@ +"use client"; +import { Button } from "@/components/ui/button"; +import { useRouter } from "@/hooks/use-performance-router"; +import { + ArrowUpRight, + Building, + Handshake, + LucideIcon, + SquareUserRound, +} from "lucide-react"; +import React from "react"; + +interface GoToPageButtonProps { + label: string; + href: string; +} + +export function GoToPageButton(props: GoToPageButtonProps) { + let IconComponent; + + const router = useRouter({ + fancy: true, + }); + + const handleClick = () => { + router.push(props.href); + }; + + switch (props.href) { + case "/app/leads": + IconComponent = ; + break; + case "/app/clients": + IconComponent = ; + break; + case "/app/deals": + IconComponent = ; + break; + default: + IconComponent = ; + break; + } + + return ( + + ); +} diff --git a/src/app/app/home/page.tsx b/src/app/app/home/page.tsx index be3c23e..5a430dd 100644 --- a/src/app/app/home/page.tsx +++ b/src/app/app/home/page.tsx @@ -1,7 +1,9 @@ import { PageTitle } from "@/components/PageTitle"; import { Button } from "@/components/ui/button"; +import { Building } from "lucide-react"; import { redirect } from "next/navigation"; import React from "react"; +import { GoToPageButton } from "./_components/GoToPageButton"; export default async function HomePage() { return (
@@ -13,6 +15,11 @@ export default async function HomePage() { +
+ Go to + or + or +
); }