From 1872e2aa0a319ebbd8ee47708df6b6f69536db8c Mon Sep 17 00:00:00 2001 From: bender Date: Thu, 12 Mar 2026 13:28:35 +0000 Subject: [PATCH] Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx --- .../shared/SvgTextLogo/SvgTextLogo.tsx | 91 ++++++++++--------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..898d116 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,56 @@ -"use client"; +import React, { SVGProps } from "react"; -import { memo } from "react"; -import useSvgTextLogo from "./useSvgTextLogo"; -import { cls } from "@/lib/utils"; - -interface SvgTextLogoProps { - logoText: string; - adjustHeightFactor?: number; - verticalAlign?: "top" | "center"; - className?: string; +interface SvgTextLogoProps extends SVGProps { + text: string; + fontSize?: number; + fontWeight?: number | string; + letterSpacing?: number; } -const SvgTextLogo = memo(function SvgTextLogo({ - logoText, - adjustHeightFactor, - verticalAlign = "top", - className = "", -}) { - const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); +const SvgTextLogo = React.forwardRef( + ( + { + text, + fontSize = 48, + fontWeight = 700, + letterSpacing = 0, + className, + ...props + }, + ref + ) => { + const textLength = text.length; + const charWidth = fontSize * 0.6; + const width = textLength * charWidth + 40; + const height = fontSize + 20; - return ( - - - {logoText} - - - ); -}); + + {text} + + + ); + } +); SvgTextLogo.displayName = "SvgTextLogo"; -export default SvgTextLogo; +export default SvgTextLogo; \ No newline at end of file