Files
7b8faa0e-34b2-4252-9fc4-c4f…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

40 lines
913 B
TypeScript

import React from "react";
interface SvgTextLogoProps {
text: string;
className?: string;
fontSize?: number;
fontWeight?: number | string;
letterSpacing?: number;
dominantBaseline?: "middle" | "auto" | "central" | "text-after-edge";
}
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
text,
className = "", fontSize = 48,
fontWeight = 700,
letterSpacing = 2,
dominantBaseline = "middle"}) => {
return (
<svg
viewBox={`0 0 ${text.length * fontSize * 0.6} ${fontSize * 1.2}`}
className={className}
xmlns="http://www.w3.org/2000/svg"
>
<text
x="50%"
y="50%"
textAnchor="middle"
dominantBaseline={dominantBaseline}
fontSize={fontSize}
fontWeight={fontWeight}
letterSpacing={letterSpacing}
fill="currentColor"
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;