import { LucideIcon } from 'lucide-react'; import * as React from 'react'; import { IconType } from 'react-icons'; import { cn } from '@/lib/utils'; import UnstyledLink, { UnstyledLinkProps, } from '@/components/links/UnstyledLink'; const ButtonLinkVariant = [ 'primary', 'outline', 'ghost', 'light', 'dark', ] as const; const ButtonLinkSize = ['sm', 'base'] as const; type ButtonLinkProps = { isDarkBg?: boolean; variant?: (typeof ButtonLinkVariant)[number]; size?: (typeof ButtonLinkSize)[number]; leftIcon?: IconType | LucideIcon; rightIcon?: IconType | LucideIcon; classNames?: { leftIcon?: string; rightIcon?: string; }; } & UnstyledLinkProps; const ButtonLink = React.forwardRef( ( { children, className, variant = 'primary', size = 'base', isDarkBg = false, leftIcon: LeftIcon, rightIcon: RightIcon, classNames, ...rest }, ref ) => { return ( {LeftIcon && (
)} {children} {RightIcon && (
)}
); } ); export default ButtonLink;