Files
dbb5c004-0ca3-4751-b023-6fe…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

46 lines
1.3 KiB
TypeScript

import React from 'react';
interface SvgTextLogoProps {
text: string;
className?: string;
textAnchor?: 'start' | 'middle' | 'end';
dominantBaseline?: 'auto' | 'inherit' | 'alphabetic' | 'hanging' | 'ideographic' | 'mathematical' | 'text-before-edge' | 'middle' | 'central' | 'text-after-edge' | 'use-script' | 'no-change' | 'reset-size';
}
export const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className = '',
textAnchor = 'middle',
dominantBaseline = 'central',
}) => {
return (
<svg
viewBox="0 0 1200 400"
className={`w-full h-auto ${className}`}
preserveAspectRatio="xMidYMid meet"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
<linearGradient id="textGradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style={{ stopColor: '#3b82f6', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: '#8b5cf6', stopOpacity: 1 }} />
</linearGradient>
</defs>
<text
x="50%"
y="50%"
textAnchor={textAnchor}
dominantBaseline={dominantBaseline}
className="text-6xl font-bold fill-current"
style={{
fill: 'url(#textGradient)',
fontFamily: 'system-ui, -apple-system, sans-serif',
}}
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;