mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
20 lines
424 B
TypeScript
20 lines
424 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;
|