import React from 'react';

interface SvgTextLogoProps {
  text: string;
  fontSize?: number;
  fontWeight?: number | string;
  letterSpacing?: number;
  className?: string;
}

const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
  text,
  fontSize = 32,
  fontWeight = 700,
  letterSpacing = 0,
  className = '',
}) => {
  const textLength = text.length;
  const charWidth = fontSize * 0.6;
  const width = textLength * charWidth + 20;
  const height = fontSize + 20;

  return (
    <svg
      width={width}
      height={height}
      viewBox={`0 0 ${width} ${height}`}
      className={className}
      role="img"
      aria-label={text}
    >
      <text
        x={10}
        y={fontSize + 5}
        fontSize={fontSize}
        fontWeight={fontWeight}
        letterSpacing={letterSpacing}
        fill="currentColor"
        dominantBaseline="middle"
      >
        {text}
      </text>
    </svg>
  );
};

export default SvgTextLogo;
