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

function IconPluginComponent(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-Plugin${loadingKls} ${className}`} width={width} height={height} viewBox="0 0 24 24" fill={useCurrentColor ? 'currentColor' : '#000'} xmlns="http://www.w3.org/2000/svg" {...rest} ref={ref}><path d="M16 1.5C18.2091 1.5 20 3.29086 20 5.5V6.25H22.75C23.4404 6.25 24 6.80964 24 7.5C24 8.19035 23.4404 8.75 22.75 8.75H20V15.25H22.75C23.4404 15.25 24 15.8096 24 16.5C24 17.1904 23.4404 17.75 22.75 17.75H20V18.5C20 20.7091 18.2091 22.5 16 22.5H10C5.02944 22.5 1 18.4706 1 13.5V10.5C1 5.52944 5.02944 1.5 10 1.5H16ZM10 3.5C6.13401 3.5 3 6.63401 3 10.5V13.5C3 17.366 6.13401 20.5 10 20.5H16C17.1046 20.5 18 19.6046 18 18.5V5.5C18 4.39543 17.1046 3.5 16 3.5H10ZM7 9C7.55228 9 8 9.44772 8 10V14C8 14.5523 7.55228 15 7 15C6.44772 15 6 14.5523 6 14V10C6 9.44772 6.44772 9 7 9Z"/></svg>;
}

const IconPlugin = React.forwardRef(IconPluginComponent);
export default IconPlugin;
