import { useMemo } from 'react';

import { Label } from '@/components/ui/label';
import { LL } from '@/lang/Lang';

import { ItemDataProps } from '../types';

const DataLabel = (props: ItemDataProps) => {

    if (props.hideLabel) return null;

    const title = useMemo(() => {
        return props.structure.title ?? "";
    }, [props.structure.title]);




    return <Label
        className='overflow-hidden truncate'
        required={!!props.structure.required}><LL value={title} /></Label>

}

export default DataLabel;