Files
899b4fd6-831d-4869-8d08-051…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

51 lines
1.2 KiB
TypeScript

import React from 'react';
interface SvgTextLogoProps {
text: string;
className?: string;
fontSize?: number;
fontWeight?: number | string;
letterSpacing?: number;
textAnchor?: 'start' | 'middle' | 'end';
dominantBaseline?: 'auto' | 'middle' | 'hanging';
}
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className = '',
fontSize = 48,
fontWeight = 700,
letterSpacing = 0,
textAnchor = 'start',
dominantBaseline = 'middle',
}) => {
return (
<svg
viewBox="0 0 1000 200"
className={`w-full h-auto ${className}`}
preserveAspectRatio="xMidYMid meet"
>
<defs>
<linearGradient id="textGradient" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: '#ffffff', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: '#d1d5db', stopOpacity: 1 }} />
</linearGradient>
</defs>
<text
x="50%"
y="50%"
fontSize={fontSize}
fontWeight={fontWeight}
letterSpacing={letterSpacing}
textAnchor={textAnchor}
dominantBaseline={dominantBaseline}
fill="url(#textGradient)"
fontFamily="inherit"
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;