import React, { ForwardedRef, useContext } from 'react';
import { OriginIconProps } from '../type';
import { Context } from '../context';

function IconPenComponent(props: OriginIconProps, ref: ForwardedRef<SVGSVGElement>) {
    const { prefix: prefixFromContext } = useContext(Context);
    const { className = '', prefix: prefixFromProps, width = '1em', height = '1em', useCurrentColor = true, spin, ...rest } = props;

    const prefix = prefixFromProps || prefixFromContext || 'hiagent';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-pen${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 48 48" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path fillRule="evenodd" clipRule="evenodd" d="M25.734 3.02a2 2 0 00-3.468 0L10.405 23.674a2 2 0 00-.203 1.492l3.605 14.082a1 1 0 00.97.752h18.447a1 1 0 00.969-.752l3.605-14.082a2 2 0 00-.203-1.492L25.735 3.02zM42 43a1 1 0 00-1-1H7a1 1 0 00-1 1v2a1 1 0 001 1h34a1 1 0 001-1v-2zM22 11.513L14.278 24.96 17.105 36h13.79l2.827-11.04L26 11.517V21a1 1 0 01-1 1h-2a1 1 0 01-1-1v-9.487zM26 28a2 2 0 10-4 0 2 2 0 004 0z"/></svg>;
}

const IconPen = React.forwardRef(IconPenComponent);
export default IconPen;
