mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
26 lines
714 B
TypeScript
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>
|
|
);
|
|
}
|