import { cn } from '@/lib/utils';
import { Link } from '@inertiajs/react';
import { ComponentProps } from 'react';

type LinkProps = ComponentProps<typeof Link> & {
  variant?: 'default' | 'underlined';
};

export default function TextLink({
  className = '',
  children,
  variant = 'default',
  ...props
}: LinkProps) {
  return (
    <Link
      className={cn(
        'text-foreground',
        variant === 'default' && 'no-underline',
        variant === 'underlined' && 'text-foreground/50 underline',
        className,
      )}
      {...props}
    >
      {children}
    </Link>
  );
}
