(0);
const lines = children.split('\n');
useEffect(() => {
if (animation === 'reveal') {
setRevealedLines(0);
let lineIndex = 0;
const interval = setInterval(() => {
if (lineIndex < lines.length) {
setRevealedLines(lineIndex + 1);
lineIndex++;
} else {
clearInterval(interval);
}
}, revealDelay);
return () => clearInterval(interval);
}
}, [animation, lines.length, revealDelay, children]);
const renderContent = () => {
if (animation === 'reveal') {
return lines.map((line, i) => (
{line}
{'\n'}
));
}
return children;
};
return (
{bordered && title && (
┌{title}┐
)}
{renderContent()}
);
}
);
AsciiArt.displayName = 'AsciiArt';
export default AsciiArt;