import { React, PropTypes } from '@gravityforms/libraries';

const { forwardRef } = React;

/**
 * @module SparkPostLogo
 * @description The SparkPost logo.
 *
 * @since 2.3.1
 *
 * @param {object}      props        Component props.
 * @param {number}      props.height The height of the logo.
 * @param {string}      props.title  The title of the logo.
 * @param {number}      props.width  The width of the logo.
 * @param {object|null} ref          Ref to the component.
 *
 * @return {JSX.Element} The svg component.
 * @example
 * import SparkPostLogo from '@gravityforms/components/react/admin/elements/Svgs/SparkPostLogo';
 *
 * return (
 *    <SparkPostLogo height={ 44 } width={ 44 } />
 * );
 *
 */
const SparkPostLogo = forwardRef( ( {
	height = 44,
	title = '',
	width = 44,
}, ref ) => {
	return (
		<svg xmlns="http://www.w3.org/2000/svg" width={ width } height={ height } viewBox="4 3 92 92" fill="none" ref={ ref }>
			{ title !== '' && <title>{ title }</title> }
			<g filter="url(#filter0_d_3582_119685)">
				<rect width="92" height="92" x="4" y="3" fill="#F1F1F1" rx="46" />
				<path fill="#FA6423" d="M61.418 41.646c-3.669 2.743-4.43 7.614-4.5 10.906-5.815-6.722 10.8-26.41-8.099-38.552 11.7 15.023-16.684 29.84-16.684 51.998 0 8.712 5.469 16.327 17.515 19.002 11.769-2.47 17.653-10.29 17.653-19.002-.07-12.965-8.239-17.287-5.885-24.352Zm-11.77 36.22c-6.437 0-11.629-5.145-11.629-11.525 0-6.38 5.192-11.524 11.63-11.524 6.439 0 11.63 5.144 11.63 11.524 0 6.38-5.26 11.525-11.63 11.525Z" />
			</g>
			<defs>
				<filter id="filter0_d_3582_119685" width="100" height="100" x="0" y="0" colorInterpolationFilters="sRGB" filterUnits="userSpaceOnUse">
					<feFlood floodOpacity="0" result="BackgroundImageFix" />
					<feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" />
					<feOffset dy="1" />
					<feGaussianBlur stdDeviation="2" />
					<feColorMatrix values="0 0 0 0 0.0687866 0 0 0 0 0.097585 0 0 0 0 0.37981 0 0 0 0.0779552 0" />
					<feBlend in2="BackgroundImageFix" result="effect1_dropShadow_3582_119685" />
					<feBlend in="SourceGraphic" in2="effect1_dropShadow_3582_119685" result="shape" />
				</filter>
			</defs>
		</svg>
	);
} );

SparkPostLogo.propTypes = {
	height: PropTypes.number,
	title: PropTypes.string,
	width: PropTypes.number,
};

SparkPostLogo.displayName = 'Svgs/SparkPostLogo';

export default SparkPostLogo;
