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

const { forwardRef } = React;

/**
 * @module TwilioLogo
 * @description The Twilio 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 TwilioLogo from '@gravityforms/components/react/admin/elements/Svgs/TwilioLogo';
 *
 * return (
 *    <TwilioLogo height={ 44 } width={ 44 } />
 * );
 *
 */
const TwilioLogo = forwardRef( ( {
	height = 44,
	title = '',
	width = 44,
}, ref ) => {
	return (
		<svg xmlns="http://www.w3.org/2000/svg" width={ width } height={ height } viewBox="4 3.043 92 92" fill="none" ref={ ref }>
			{ title !== '' && <title>{ title }</title> }
			<g filter="url(#filter0_d_2944_85284)">
				<rect width="92" height="92" x="4" y="3.043" fill="#F22F46" rx="46" />
				<path fill="#fff" d="M48.36 41.513c0 3.23-2.66 5.89-5.89 5.89-3.23 0-5.89-2.66-5.89-5.89 0-3.23 2.66-5.89 5.89-5.89 3.23 0 5.89 2.66 5.89 5.89Zm-5.89 8.17c-3.23 0-5.89 2.66-5.89 5.89 0 3.23 2.66 5.89 5.89 5.89 3.23 0 5.89-2.66 5.89-5.89 0-3.23-2.66-5.89-5.89-5.89ZM78 48.543c0 15.77-12.73 28.5-28.5 28.5S21 64.313 21 48.543s12.73-28.5 28.5-28.5S78 32.773 78 48.543Zm-7.6 0c0-11.59-9.31-20.9-20.9-20.9a20.84 20.84 0 0 0-20.9 20.9c0 11.59 9.31 20.9 20.9 20.9 11.59 0 20.9-9.31 20.9-20.9Zm-13.87 1.14c-3.23 0-5.89 2.66-5.89 5.89 0 3.23 2.66 5.89 5.89 5.89 3.23 0 5.89-2.66 5.89-5.89 0-3.23-2.66-5.89-5.89-5.89Zm0-14.06c-3.23 0-5.89 2.66-5.89 5.89 0 3.23 2.66 5.89 5.89 5.89 3.23 0 5.89-2.66 5.89-5.89 0-3.23-2.66-5.89-5.89-5.89Z" />
			</g>
			<defs>
				<filter id="filter0_d_2944_85284" width="100" height="100" x="0" y=".043" 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_2944_85284" />
					<feBlend in="SourceGraphic" in2="effect1_dropShadow_2944_85284" result="shape" />
				</filter>
			</defs>
		</svg>
	);
} );

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

TwilioLogo.displayName = 'Svgs/TwilioLogo';

export default TwilioLogo;
