-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added go to buttons to home page
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = <Building className="mr-1.5" size={12} />; | ||
break; | ||
case "/app/clients": | ||
IconComponent = <SquareUserRound className="mr-1.5" size={12} />; | ||
break; | ||
case "/app/deals": | ||
IconComponent = <Handshake className="mr-1.5" size={12} />; | ||
break; | ||
default: | ||
IconComponent = <ArrowUpRight className="mr-1.5" size={12} />; | ||
break; | ||
} | ||
|
||
return ( | ||
<Button onClick={handleClick} variant={"outline"} className="h-7 px-1.5"> | ||
{IconComponent} | ||
{props.label} | ||
</Button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters