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

function IconPinLineComponent(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 || 'font';
    const loadingKls = spin ? ` ${prefix}-icon-loading` : '';
    return <svg className={`${prefix}-icon ${prefix}-icon-pin-line${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 16 16" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M8.16211 1.26855C8.42212 1.00855 8.8354 0.970168 9.12988 1.26465L14.499 6.63379C14.7535 6.88836 14.7915 7.30709 14.501 7.59766C14.3234 7.77506 13.8912 7.91065 13.5566 7.57617L12.7568 6.78223L10.623 8.91602C10.5599 8.97929 10.543 9.08438 10.543 9.1709L10.249 13.373C10.249 13.463 10.2127 13.5499 10.1494 13.6133L9.77051 13.9922C9.50701 14.2566 9.08151 14.2573 8.82227 13.998L5.7666 10.9443L2.65723 14.0537C2.39687 14.314 1.97421 14.3141 1.71387 14.0537L1.7041 14.0439C1.4441 13.7838 1.44333 13.3619 1.70312 13.1016L4.81152 9.98828L1.75586 6.93164C1.48568 6.66138 1.49297 6.24248 1.75684 5.97852L2.13574 5.60059C2.19911 5.53725 2.28543 5.50098 2.375 5.50098L6.58203 5.21094C6.67169 5.21093 6.78629 5.20296 6.84961 5.13965L8.9834 3.00586L8.18652 2.20703C7.93336 1.95639 7.91066 1.52042 8.16211 1.26855ZM7.4043 6.51562L3.49316 6.7832L9.00586 12.2988L9.28418 8.41309L11.8359 5.85645L9.94727 3.96973L7.4043 6.51562Z"/></svg>;
}

const IconPinLine = React.forwardRef(IconPinLineComponent);
export default IconPinLine;
