import { jsx } from 'react/jsx-runtime';
import { useTypewriter } from '../../../hooks/useTypewriter.js';

/**
 * TypeWriter component that animates text word-by-word
 *
 * @example
 * ```tsx
 * <TypeWriter
 *   text="Hello world, this is a typing animation"
 *   speed={100}
 *   enabled={true}
 * />
 * ```
 */
const TypeWriter = ({ text, speed = 100, enabled = true, onComplete, className, }) => {
    const { displayText } = useTypewriter({
        text,
        speed,
        enabled,
        onComplete,
    });
    return jsx("p", { className: className, children: displayText });
};
TypeWriter.displayName = 'TypeWriter';

export { TypeWriter };
