Files
35fec5fe-5aba-4cb1-9a15-baa…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

48 lines
1.0 KiB
TypeScript

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