diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..3d1a421 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,55 @@ -"use client"; - -import { memo } from "react"; -import useSvgTextLogo from "./useSvgTextLogo"; -import { cls } from "@/lib/utils"; +import React from 'react'; interface SvgTextLogoProps { - logoText: string; - adjustHeightFactor?: number; - verticalAlign?: "top" | "center"; + text: string; + fontSize?: number; + fontFamily?: string; + fontWeight?: string | number; + letterSpacing?: number; + fill?: string; className?: string; } -const SvgTextLogo = memo(function SvgTextLogo({ - logoText, - adjustHeightFactor, - verticalAlign = "top", - className = "", -}) { - const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); +const SvgTextLogo: React.FC = ({ + text, + fontSize = 48, + fontFamily = 'system-ui, -apple-system, sans-serif', + fontWeight = 700, + letterSpacing = 0, + fill = 'currentColor', + className = '', +}) => { + // Estimate text width based on character count and font size + const estimatedCharWidth = fontSize * 0.55; // Approximate average character width + const textWidth = text.length * estimatedCharWidth; + const padding = fontSize * 0.4; + const svgWidth = textWidth + padding * 2; + const svgHeight = fontSize * 1.5; + const textY = fontSize * 1.1; return ( - {logoText} + {text} ); -}); - -SvgTextLogo.displayName = "SvgTextLogo"; +}; export default SvgTextLogo;