'use client'; import { forwardRef, HTMLAttributes } from 'react'; import styles from './ancient-scroll.module.css'; export interface AncientScrollProps extends HTMLAttributes { /** The text to display on the scroll */ children: string; /** Level of paper decay: pristine, aged, weathered, crumbling */ decay?: 'pristine' | 'aged' | 'weathered' | 'crumbling'; /** Ink color style: black, brown, red, gold */ inkColor?: 'black' | 'brown' | 'red' | 'gold'; /** Enable flowing ink animation */ flowingInk?: boolean; /** Show aged paper texture */ showTexture?: boolean; } export const AncientScroll = forwardRef( ( { children, decay = 'aged', inkColor = 'brown', flowingInk = true, showTexture = true, className, style, ...props }, ref ) => { const inkColorMap = { black: '#1a1a1a', brown: '#4a3728', red: '#8b2942', gold: '#c9a227', }; const selectedInkColor = inkColorMap[inkColor]; return ( {children.split('\n').map((paragraph, index) => ( {paragraph.split('').map((char, charIndex) => ( {char} ))} ))} ); } ); AncientScroll.displayName = 'AncientScroll'; export default AncientScroll;
{paragraph.split('').map((char, charIndex) => ( {char} ))}