Files
93384000-e7f2-4bfd-8622-bfa…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

42 lines
939 B
TypeScript

import React from 'react';
interface SvgTextLogoProps {
text: string;
className?: string;
fontSize?: number;
fontWeight?: 'normal' | 'bold' | 'bolder';
letterSpacing?: number;
}
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className = '',
fontSize = 48,
fontWeight = 'bold',
letterSpacing = 0,
}) => {
return (
<svg
viewBox={`0 0 ${text.length * fontSize * 0.6} ${fontSize * 1.2}`}
xmlns="http://www.w3.org/2000/svg"
className={`w-full h-auto ${className}`}
preserveAspectRatio="xMidYMid meet"
>
<text
x="50%"
y="50%"
textAnchor="middle"
dominantBaseline="central"
fontSize={fontSize}
fontWeight={fontWeight}
letterSpacing={letterSpacing}
fill="currentColor"
fontFamily="system-ui, -apple-system, sans-serif"
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;