Files
e09631de-fe86-46a7-861f-05f…/src/components/shared/SvgTextLogo/SvgTextLogo.tsx

49 lines
1.2 KiB
TypeScript

import React from "react";
interface SvgTextLogoProps {
text: string;
className?: string;
fontSize?: number;
fontFamily?: string;
fontWeight?: number | string;
letterSpacing?: number;
fill?: string;
x?: number;
y?: number;
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,
fontSize = 32,
fontFamily = "serif", fontWeight = 400,
letterSpacing = 0,
fill = "currentColor", x = 0,
y = 0,
dominantBaseline = "central"}) => {
return (
<svg
className={className}
viewBox={`0 0 ${text.length * fontSize * 0.6} ${fontSize * 1.5}`}
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="xMidYMid meet"
>
<text
x={x}
y={y}
fontSize={fontSize}
fontFamily={fontFamily}
fontWeight={fontWeight}
letterSpacing={letterSpacing}
fill={fill}
dominantBaseline={dominantBaseline}
>
{text}
</text>
</svg>
);
};
export default SvgTextLogo;