Files
72fe5ef3-1983-43f6-a0ea-8f6…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

55 lines
1.3 KiB
TypeScript

import React, { SVGProps } from 'react';
interface SvgTextLogoProps extends SVGProps<SVGSVGElement> {
text?: string;
fontSize?: number;
fontWeight?: string | number;
fontFamily?: string;
fill?: string;
dominantBaseline?: 'auto' | 'baseline' | 'middle' | 'hanging' | 'text-top' | 'text-bottom' | 'central' | 'mathematical' | 'inherit';
}
export const SvgTextLogo = React.forwardRef<SVGSVGElement, SvgTextLogoProps>(
(
{
text = 'Logo',
fontSize = 48,
fontWeight = 'bold',
fontFamily = 'system-ui, -apple-system, sans-serif',
fill = 'currentColor',
dominantBaseline = 'central',
viewBox = '0 0 200 60',
width = 200,
height = 60,
...props
},
ref
) => {
return (
<svg
ref={ref}
viewBox={viewBox}
width={width}
height={height}
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<text
x="50%"
y="50%"
textAnchor="middle"
dominantBaseline={dominantBaseline}
fontSize={fontSize}
fontWeight={fontWeight}
fontFamily={fontFamily}
fill={fill}
>
{text}
</text>
</svg>
);
}
);
SvgTextLogo.displayName = 'SvgTextLogo';