Openstatus www.openstatus.dev
at main 32 lines 790 B view raw
1import { cn } from "@/lib/utils"; 2import { type VariantProps, cva } from "class-variance-authority"; 3import NextLink from "next/link"; 4 5export const linkVariants = cva( 6 // NOTE: use same ring styles as the button 7 "outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm", 8 { 9 variants: { 10 variant: { 11 default: "text-foreground font-medium", 12 container: "focus-visible:border-ring", 13 }, 14 }, 15 defaultVariants: { 16 variant: "default", 17 }, 18 }, 19); 20 21export function Link({ 22 children, 23 className, 24 variant, 25 ...props 26}: React.ComponentProps<typeof NextLink> & VariantProps<typeof linkVariants>) { 27 return ( 28 <NextLink className={cn(linkVariants({ variant, className }))} {...props}> 29 {children} 30 </NextLink> 31 ); 32}