41 lines
838 B
TypeScript
41 lines
838 B
TypeScript
import React from "react";
|
|
|
|
interface SvgTextLogoProps {
|
|
text: string;
|
|
fontSize?: number;
|
|
fontWeight?: number;
|
|
fill?: string;
|
|
className?: string;
|
|
}
|
|
|
|
export const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
|
text,
|
|
fontSize = 24,
|
|
fontWeight = 700,
|
|
fill = "currentColor", className,
|
|
}) => {
|
|
const textWidth = text.length * (fontSize * 0.6);
|
|
const viewBoxWidth = textWidth + 40;
|
|
const viewBoxHeight = fontSize + 20;
|
|
|
|
return (
|
|
<svg
|
|
viewBox={`0 0 ${viewBoxWidth} ${viewBoxHeight}`}
|
|
className={className}
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<text
|
|
x={20}
|
|
y={fontSize + 5}
|
|
fontSize={fontSize}
|
|
fontWeight={fontWeight}
|
|
fill={fill}
|
|
dominantBaseline="middle"
|
|
>
|
|
{text}
|
|
</text>
|
|
</svg>
|
|
);
|
|
};
|
|
|
|
export default SvgTextLogo; |