import type { ElementType } from 'react' import React, { forwardRef } from 'react' import type { PolymorphicComponentPropsWithRef, PolymorphicRef, } from '../../typings' type LinkBaseProps = { /** * ID to find this component in testing tools (e.g.: cypress, testing library, and jest). */ testId?: string /** * Specifies the component variant. */ variant?: 'default' | 'display' | 'inline' /** * Specifies the size variant. */ size?: 'small' | 'regular' /** * Defines the use of inverted colors. */ inverse?: boolean } export type LinkElementType = ElementType export type LinkProps = PolymorphicComponentPropsWithRef const Link = forwardRef< HTMLAnchorElement, Omit, 'ref'> >(function Link( { as, children, variant = 'default', size = 'regular', inverse, testId = 'fs-link', ...otherProps }: LinkProps, ref?: PolymorphicRef ) { const Component = as ?? 'a' return ( {children} ) }) export default Link