Files
ed1a6f8a-e583-4693-b1f1-9ef…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

42 lines
846 B
TypeScript

import React from 'react';
interface SvgTextLogoProps {
text: string;
className?: string;
fontSize?: number;
fontWeight?: string | number;
letterSpacing?: number;
}
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className = '',
fontSize = 48,
fontWeight = 700,
letterSpacing = 0,
}) => {
return (
<svg
viewBox={`0 0 ${text.length * fontSize * 0.6} ${fontSize * 1.5}`}
xmlns="http://www.w3.org/2000/svg"
className={className}
preserveAspectRatio="xMidYMid meet"
>
<text
x="50%"
y="50%"
textAnchor="middle"
dominantBaseline="middle"
fontSize={fontSize}
fontWeight={fontWeight}
letterSpacing={letterSpacing}
fill="currentColor"
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;