ConceptPortal-public/rsconcept/frontend/src/components/Common/Label.tsx
2023-07-25 20:27:29 +03:00

21 lines
428 B
TypeScript

interface LabelProps {
text: string
htmlFor?: string
required?: boolean
title?: string
}
function Label({ text, htmlFor, required = false, title }: LabelProps) {
return (
<label
className='text-sm font-semibold'
htmlFor={htmlFor}
title={ (required && !title) ? 'обязательное поле' : title }
>
{text + (required ? '*' : '')}
</label>
);
}
export default Label;