2023-08-02 18:24:17 +03:00
|
|
|
import { LabelHTMLAttributes } from 'react';
|
|
|
|
|
|
|
|
interface LabelProps
|
2023-10-14 23:46:36 +03:00
|
|
|
extends Omit<React.DetailedHTMLProps<LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, 'children' | 'title'> {
|
2023-07-15 17:46:19 +03:00
|
|
|
text: string
|
2023-10-14 23:46:36 +03:00
|
|
|
tooltip?: string
|
2023-07-15 17:46:19 +03:00
|
|
|
}
|
|
|
|
|
2023-11-27 13:50:56 +03:00
|
|
|
function Label({ text, tooltip, className, ...restProps }: LabelProps) {
|
2023-07-15 17:46:19 +03:00
|
|
|
return (
|
2023-12-05 01:22:44 +03:00
|
|
|
<label
|
2023-12-07 01:21:27 +03:00
|
|
|
className={`text-sm font-semibold whitespace-nowrap ${className}`}
|
2023-12-05 01:22:44 +03:00
|
|
|
title={tooltip}
|
|
|
|
{...restProps}
|
|
|
|
>
|
|
|
|
{text}
|
|
|
|
</label>);
|
2023-07-15 17:46:19 +03:00
|
|
|
}
|
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
export default Label;
|