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

function IconSaveButtonComponent(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-save-button${loadingKls} ${className}`} width={width} height={height} xmlns="http://www.w3.org/2000/svg" fill={useCurrentColor ? 'currentColor' : '#000'} viewBox="0 0 16 16" {...rest} ref={ref}><path fillRule="evenodd" d="M10.793 1.333c.355 0 .694.141.944.392l2.54 2.547c.25.25.39.588.39.941V14a.667.667 0 0 1-.667.667H2A.667.667 0 0 1 1.333 14V2c0-.368.299-.667.667-.667h8.793ZM4 2.667H2.667v10.666h10.666V5.61a.667.667 0 0 0-.194-.47l-2.27-2.277a.667.667 0 0 0-.472-.196h-.064v4.666A.667.667 0 0 1 9.667 8h-5A.667.667 0 0 1 4 7.333V2.667Zm5 0H5.333v4h1.333v-2c0-.184.15-.334.334-.334h.667c.184 0 .333.15.333.334v2h1v-4Z" clipRule="evenodd"/></svg>;
}

const IconSaveButton = React.forwardRef(IconSaveButtonComponent);
export default IconSaveButton;
