Files
bc1248b2-b910-4493-a7ec-c8a…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

42 lines
891 B
TypeScript

import React from 'react';
interface SvgTextLogoProps {
text: string;
className?: string;
fontSize?: number;
fontWeight?: number | string;
letterSpacing?: number;
dominantBaseline?: SVGTextElementAttributes<SVGTextElement>['dominantBaseline'];
}
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className = '',
fontSize = 48,
fontWeight = 'bold',
letterSpacing = 2,
dominantBaseline = 'hanging',
}) => {
return (
<svg
viewBox={`0 0 ${text.length * fontSize * 0.6} ${fontSize * 1.5}`}
className={className}
xmlns="http://www.w3.org/2000/svg"
>
<text
x="0"
y="0"
fontSize={fontSize}
fontWeight={fontWeight}
letterSpacing={letterSpacing}
dominantBaseline="hanging"
fill="currentColor"
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;