Files
18c99a40-a55a-496f-8464-68b…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

44 lines
1.1 KiB
TypeScript

import React from 'react';
interface SvgTextLogoProps {
text: string;
className?: string;
fontSize?: number;
fontWeight?: string | number;
letterSpacing?: number;
fill?: string;
dominantBaseline?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit';
}
export const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className = '',
fontSize = 24,
fontWeight = 'bold',
letterSpacing = 0,
fill = 'currentColor',
dominantBaseline = 'middle',
}) => {
return (
<svg
viewBox={`0 0 ${text.length * fontSize * 0.6} ${fontSize * 1.5}`}
className={className}
xmlns="http://www.w3.org/2000/svg"
>
<text
x="50%"
y="50%"
fontSize={fontSize}
fontWeight={fontWeight}
letterSpacing={letterSpacing}
fill={fill}
textAnchor="middle"
dominantBaseline={dominantBaseline}
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;