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