import { useLLText } from './localizationService';
import { useLang } from './Lang';

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 = useLLText(String(raw), lang);

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