Files
974dabfc-b439-4914-bbde-bb4…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

39 lines
979 B
TypeScript

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