From b32626868dd33c0a9b9c4c7bf91b91dd6c810d57 Mon Sep 17 00:00:00 2001 From: bender Date: Tue, 10 Mar 2026 20:35:47 +0000 Subject: [PATCH] Update src/components/shared/SvgTextLogo/SvgTextLogo.tsx --- .../shared/SvgTextLogo/SvgTextLogo.tsx | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..41b4b16 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,53 @@ -"use client"; - -import { memo } from "react"; -import useSvgTextLogo from "./useSvgTextLogo"; -import { cls } from "@/lib/utils"; +import React, { useMemo } from "react"; interface SvgTextLogoProps { - logoText: string; - adjustHeightFactor?: number; - verticalAlign?: "top" | "center"; + text: string; className?: string; + width?: number; + height?: number; + fontSize?: number; + fontWeight?: string | number; + fill?: string; + strokeWidth?: number; + stroke?: string; + dominantBaseline?: "hanging" | "middle" | "central" | "text-bottom" | "alphabetic" | "baseline"; } -const SvgTextLogo = memo(function SvgTextLogo({ - logoText, - adjustHeightFactor, - verticalAlign = "top", - className = "", -}) { - const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); +const SvgTextLogo: React.FC = ({ + text, + className, + width = 200, + height = 100, + fontSize = 32, + fontWeight = "bold", fill = "currentColor", strokeWidth = 0, + stroke = "none", dominantBaseline = "middle"}) => { + const textWidth = useMemo(() => { + return text.length * (fontSize * 0.6); + }, [text, fontSize]); return ( - {logoText} + {text} ); -}); +}; -SvgTextLogo.displayName = "SvgTextLogo"; - -export default SvgTextLogo; +export default SvgTextLogo; \ No newline at end of file