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

export type ReturnableIconProps = 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 ReturnableIcon = ({ title, size, color, ...props }: ReturnableIconProps) => {
  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 d="M14.75 12.445c0-.93-.477-2.067-1.05-3.257-.271-.561-.568-1.145-.787-1.652-.21-.486-.413-1.037-.413-1.531v-1.5H14v1.5c0 .151.078.446.29.935.203.47.469.992.76 1.597.552 1.144 1.2 2.583 1.2 3.908v6.305A3.251 3.251 0 0 1 13 21.995h-2V22a3.251 3.251 0 0 1-3.25-3.25v-6.305c0-1.325.648-2.764 1.2-3.908.291-.605.557-1.127.76-1.597.212-.49.29-.784.29-.935v-1.5h1.5v1.5c0 .494-.203 1.045-.413 1.531-.22.507-.516 1.091-.786 1.652-.574 1.19-1.051 2.327-1.051 3.257v6.305c0 .966.784 1.75 1.75 1.75v-.005h2c.964 0 1.747-.782 1.75-1.745zM14 11.75v7h-1.5v-7zm0-9.745v1.5h-4v-1.5z" /></svg>
  );
};