import { useId, type SVGProps } from 'react';

export type LinkIconProps = SVGProps<SVGSVGElement> & {
  /** Accessibility title for the icon, set aria-hidden="true" if the icon is purely decorative. */
  title?: string;
  /**
   * The size of the icon.
   * It sets the font-size, possible as the width and height is `1em`. If not set, the icon will inherit the font size of its parent.
   */
  size?: '2xl' | 'xl' | 'large' | 'medium' | 'small';
  /**
   * The color of the icon.
   * @default 'inherit'
   */
  color?: 'inherit' | 'primary' | 'gray' | 'black' | 'white';
};

export const LinkIcon = ({ title, size, color, ...props }: LinkIconProps) => {
  const titleId = useId();
  return (
    <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" focusable='false' role='img' width='1em' height='1em'  aria-labelledby={title ? titleId : undefined} data-size={size} data-color={color} {...props}>{title ? <title id={titleId}>{title}</title> : null}<path fillRule="evenodd" d="M2.016 12.002A5.244 5.244 0 0 1 7.259 6.76h3.745v1.5H7.259a3.744 3.744 0 0 0 0 7.487h3.745v1.5H7.259a5.244 5.244 0 0 1-5.243-5.243ZM13 6.76h3.744a5.244 5.244 0 0 1 0 10.487H13v-1.5h3.744a3.744 3.744 0 0 0 0-7.487H13zm3.994 5.993H7.009v-1.5h9.986v1.5Z" clipRule="evenodd" /></svg>
  );
};