mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-08-16 05:40:37 +03:00
21 lines
428 B
TypeScript
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;
|