Files
ddcd960b-c853-4da8-a06a-0d7…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

42 lines
914 B
TypeScript

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