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

export type XIconProps = 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 XIcon = ({ title, size, color, ...props }: XIconProps) => {
  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="M12 22.5c5.799 0 10.5-4.701 10.5-10.5S17.799 1.5 12 1.5 1.5 6.201 1.5 12 6.201 22.5 12 22.5m0 1.5c6.6274 0 12-5.3726 12-12S18.6274 0 12 0 0 5.3726 0 12s5.3726 12 12 12" clipRule="evenodd" /><path fillRule="evenodd" d="m6.4951 6.1818 7.762 11.6364h3.4026L9.685 6.1818zm1.2013.6465 6.8996 10.3434h1.8439L9.3513 6.8283z" clipRule="evenodd" /><path d="M17.1281 6.1818h-.8506l-3.6494 4.2943.3798.5542zM6.3888 17.8182h.8506l3.9342-4.6295-.3767-.5578z" /><path fillRule="evenodd" d="M6.16 6h3.6161l2.8668 4.1831L16.1977 6h1.3192l-4.2851 5.0424L18 18h-3.8354l-3.0103-4.5129L7.3192 18H6l4.5741-5.3826zm5.2339 7.2052.0031-.0037-.4507-.6673-4.116-6.1706h2.7636l7.7254 11.2728h-2.9696zm-.6137-.2789-4.0026 4.7101h.382l3.7886-4.4582zm2.2425-2.1892 3.7166-4.3735h-.3821l-3.5051 4.1246zM7.3613 6.6465h2.0811l7.3378 10.707h-2.2768zm.6702.3636 6.657 9.9798h1.4111L9.2602 7.0101z" clipRule="evenodd" /></svg>
  );
};