43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import type { SVGProps } from 'react';
|
|
|
|
interface SvgTextLogoProps extends SVGProps<SVGTextElement> {
|
|
text: string;
|
|
className?: string;
|
|
fontSize?: number;
|
|
fontWeight?: number | string;
|
|
letterSpacing?: number;
|
|
dominantBaseline?: 'auto' | 'text-before-edge' | 'middle' | 'central' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit' | 'use-script' | 'no-change' | 'reset-size';
|
|
}
|
|
|
|
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
|
text,
|
|
className = '',
|
|
fontSize = 48,
|
|
fontWeight = 'bold',
|
|
letterSpacing = 2,
|
|
dominantBaseline = 'hanging',
|
|
}) => {
|
|
return (
|
|
<svg
|
|
viewBox={`0 0 ${text.length * fontSize * 0.6} ${fontSize * 1.5}`}
|
|
className={className}
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<text
|
|
x="0"
|
|
y="0"
|
|
fontSize={fontSize}
|
|
fontWeight={fontWeight}
|
|
letterSpacing={letterSpacing}
|
|
dominantBaseline="hanging"
|
|
fill="currentColor"
|
|
>
|
|
{text}
|
|
</text>
|
|
</svg>
|
|
);
|
|
};
|
|
|
|
export default SvgTextLogo;
|