import { useLang } from './Lang';
import { resolveLLText } from './llUtils';

type LLProps = {
    children?: string | number;
    value?: string | number;
    className?: string;
};

export const LL = ({ children, value, className }: LLProps) => {
    const lang = useLang();
    const raw = value ?? children ?? '';
    const rendered = resolveLLText(raw, lang);

    if (className) return <span className={className}>{rendered}</span>;
    return <>{rendered}</>;
};
