47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
|
|
interface SvgTextLogoProps {
|
|
text: string;
|
|
className?: string;
|
|
textClassName?: string;
|
|
fontSize?: number;
|
|
fontWeight?: 'normal' | 'bold' | '700';
|
|
fill?: string;
|
|
textAnchor?: 'start' | 'middle' | 'end';
|
|
dominantBaseline?: 'auto' | 'text-after-edge' | 'alphabetic' | 'ideographic' | 'middle' | 'central' | 'mathematical' | 'hanging';
|
|
}
|
|
|
|
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
|
text,
|
|
className = '',
|
|
textClassName = '',
|
|
fontSize = 48,
|
|
fontWeight = 'bold',
|
|
fill = 'currentColor',
|
|
textAnchor = 'middle',
|
|
dominantBaseline = 'middle',
|
|
}) => {
|
|
return (
|
|
<svg
|
|
viewBox="0 0 800 200"
|
|
className={`w-full h-auto ${className}`}
|
|
preserveAspectRatio="xMidYMid meet"
|
|
>
|
|
<text
|
|
x="50%"
|
|
y="50%"
|
|
fontSize={fontSize}
|
|
fontWeight={fontWeight}
|
|
textAnchor={textAnchor}
|
|
dominantBaseline={dominantBaseline}
|
|
fill={fill}
|
|
className={`font-bold ${textClassName}`}
|
|
>
|
|
{text}
|
|
</text>
|
|
</svg>
|
|
);
|
|
};
|
|
|
|
export default SvgTextLogo;
|