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

export type LightningIconProps = 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 LightningIcon = ({ title, size, color, ...props }: LightningIconProps) => {
  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="M13.252 2.016v6.74h5.567v1.43l-.084.163-5.786 11.233-.21.406h-1.985v-6.745H5.182v-1.425l.083-.162 6-11.64zM6.908 13.743h5.346v5.912l4.843-9.399h-5.345v-5.91z" /></svg>
  );
};