Files
docmost/frontend/src/components/sidebar/navigation/navigation-link.tsx
T
2023-09-04 19:38:40 +01:00

26 lines
714 B
TypeScript

import { ReactNode } from "react";
import { buttonVariants } from "@/components/ui/button";
import Link from "next/link";
import { cn } from "@/lib/utils";
interface NavigationLinkProps {
children: ReactNode,
href: string;
icon?: ReactNode;
variant?: "default" | "ghost" | "outline";
className?: string;
}
export default function NavigationLink({ children, href, icon, variant = "ghost", className }: NavigationLinkProps) {
return (
<Link href={href} className={cn(buttonVariants({ variant: variant }), className)}>
{icon && <span className="mr-[8px]">
{icon}
</span>}
<span className="text-ellipsis overflow-hidden">
{children}
</span>
</Link>
);
}