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

export type ErrorIconProps = 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 ErrorIcon = ({ title, size, color, ...props }: ErrorIconProps) => {
  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="m15.723 3.014 5.267 5.262v7.447l-5.266 5.267H8.276l-5.261-5.268V8.277l5.262-5.263zM4.515 8.898v6.204l4.382 4.388h6.205l4.388-4.388V8.897l-4.387-4.383H8.897zm11.528.14-2.974 2.97 2.984 2.984-1.06 1.06-2.985-2.984-2.986 2.984-1.06-1.06 2.986-2.984-2.97-2.97 1.06-1.06 2.97 2.97 2.974-2.97z" /></svg>
  );
};