Files
5e177295-7614-41c1-9727-760…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

50 lines
1.0 KiB
TypeScript

import React from 'react';
interface SvgTextLogoProps {
text: string;
className?: string;
x?: number;
y?: number;
fontSize?: number;
fontFamily?: string;
fontWeight?: string | number;
fill?: string;
textAnchor?: 'start' | 'middle' | 'end';
dominantBaseline?: 'auto' | 'middle' | 'central' | 'hanging';
}
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className,
x = 0,
y = 0,
fontSize = 24,
fontFamily = 'Arial, sans-serif',
fontWeight = 'bold',
fill = 'currentColor',
textAnchor = 'middle',
dominantBaseline = 'central',
}) => {
return (
<svg
viewBox={`0 0 ${text.length * fontSize} ${fontSize * 2}`}
className={className}
xmlns="http://www.w3.org/2000/svg"
>
<text
x={x}
y={y}
fontSize={fontSize}
fontFamily={fontFamily}
fontWeight={fontWeight}
fill={fill}
textAnchor={textAnchor}
dominantBaseline={dominantBaseline}
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;