diff --git a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx index f214190..d000fb1 100644 --- a/src/components/shared/SvgTextLogo/SvgTextLogo.tsx +++ b/src/components/shared/SvgTextLogo/SvgTextLogo.tsx @@ -1,51 +1,60 @@ -"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; className?: string; + fontSize?: number; + fontFamily?: string; + fontWeight?: 'normal' | 'bold' | 'bolder'; + letterSpacing?: number; + textAnchor?: 'start' | 'middle' | 'end'; + dominantBaseline?: 'auto' | 'text-top' | 'text-bottom' | 'central' | 'middle' | 'hanging'; } -const SvgTextLogo = memo(function SvgTextLogo({ - logoText, - adjustHeightFactor, - verticalAlign = "top", - className = "", -}) { - const { svgRef, textRef, viewBox, aspectRatio } = useSvgTextLogo(logoText, false, adjustHeightFactor); +const SvgTextLogo = React.forwardRef( + ( + { + text, + className = '', + fontSize = 48, + fontFamily = 'system-ui, -apple-system, sans-serif', + fontWeight = 'normal', + letterSpacing = 0, + textAnchor = 'start', + dominantBaseline = 'middle', + }, + ref + ) => { + const padding = 20; + const estimatedWidth = text.length * (fontSize * 0.6) + padding * 2; + const estimatedHeight = fontSize * 1.5 + padding * 2; - return ( - - - {logoText} - - - ); -}); + + {text} + + + ); + } +); -SvgTextLogo.displayName = "SvgTextLogo"; +SvgTextLogo.displayName = 'SvgTextLogo'; export default SvgTextLogo;