import React from 'react'; interface SvgTextLogoProps { text: string; className?: string; fontSize?: number; fontWeight?: number | string; letterSpacing?: number; dominantBaseline?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit'; } const SvgTextLogo: React.FC = ({ text, className = '', fontSize = 32, fontWeight = 700, letterSpacing = 0, dominantBaseline = 'central', }) => { const textElement = React.useRef(null); const [bbox, setBbox] = React.useState({ x: 0, y: 0, width: 0, height: 0 }); React.useEffect(() => { if (textElement.current) { try { const bboxValue = textElement.current.getBBox(); setBbox(bboxValue); } catch (error) { console.error('Error getting text bbox:', error); } } }, [text, fontSize, fontWeight, letterSpacing]); const padding = 16; const viewBoxX = bbox.x - padding; const viewBoxY = bbox.y - padding; const viewBoxWidth = bbox.width + padding * 2; const viewBoxHeight = bbox.height + padding * 2; return ( {text} ); }; export default SvgTextLogo;