Files
7173eba2-7bf4-4c26-8510-d1f…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

49 lines
1.0 KiB
TypeScript

import React from 'react';
interface SvgTextLogoProps {
text: string;
className?: string;
textClassName?: string;
fontSize?: number;
fontFamily?: string;
fontWeight?: number | string;
fill?: string;
letterSpacing?: number;
}
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className = '',
textClassName = '',
fontSize = 48,
fontFamily = 'Arial, sans-serif',
fontWeight = 'bold',
fill = 'currentColor',
letterSpacing = 0,
}) => {
return (
<svg
viewBox={`0 0 ${text.length * fontSize * 0.6} ${fontSize * 1.5}`}
className={`inline-block ${className}`}
xmlns="http://www.w3.org/2000/svg"
>
<text
x="0"
y={fontSize}
className={textClassName}
style={{
fontSize: `${fontSize}px`,
fontFamily,
fontWeight,
fill,
letterSpacing: `${letterSpacing}px`,
dominantBaseline: 'hanging',
}}
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;