52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
import React, { SVGProps } from 'react';
|
|
|
|
interface SvgTextLogoProps extends SVGProps<SVGSVGElement> {
|
|
text?: string;
|
|
fontSize?: number;
|
|
fontFamily?: string;
|
|
fontWeight?: number | string;
|
|
letterSpacing?: number;
|
|
textAnchor?: 'start' | 'middle' | 'end';
|
|
dominantBaseline?: 'auto' | 'middle' | 'hanging';
|
|
}
|
|
|
|
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
|
text = 'LOGO',
|
|
fontSize = 48,
|
|
fontFamily = 'Arial, sans-serif',
|
|
fontWeight = 'bold',
|
|
letterSpacing = 2,
|
|
textAnchor = 'middle',
|
|
dominantBaseline = 'middle',
|
|
width = '200',
|
|
height = '100',
|
|
viewBox = '0 0 200 100',
|
|
...props
|
|
}) => {
|
|
return (
|
|
<svg
|
|
width={width}
|
|
height={height}
|
|
viewBox={viewBox as string}
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
{...props}
|
|
>
|
|
<text
|
|
x="50%"
|
|
y="50%"
|
|
fontSize={fontSize}
|
|
fontFamily={fontFamily}
|
|
fontWeight={fontWeight}
|
|
letterSpacing={letterSpacing}
|
|
textAnchor={textAnchor}
|
|
dominantBaseline={dominantBaseline}
|
|
fill="currentColor"
|
|
>
|
|
{text}
|
|
</text>
|
|
</svg>
|
|
);
|
|
};
|
|
|
|
export default SvgTextLogo;
|