2023-12-15 17:34:50 +03:00
|
|
|
import clsx from 'clsx';
|
2023-12-18 19:42:27 +03:00
|
|
|
|
|
|
|
import { CProps } from '../props';
|
2023-08-02 18:24:17 +03:00
|
|
|
|
|
|
|
interface LabelProps
|
2023-12-18 19:42:27 +03:00
|
|
|
extends CProps.Label {
|
2023-12-15 17:34:50 +03:00
|
|
|
text?: string
|
2023-07-15 17:46:19 +03:00
|
|
|
}
|
|
|
|
|
2023-12-18 19:42:27 +03:00
|
|
|
function Label({ text, className, ...restProps }: LabelProps) {
|
2023-12-15 17:34:50 +03:00
|
|
|
if (!text) {
|
|
|
|
return null;
|
|
|
|
}
|
2023-07-15 17:46:19 +03:00
|
|
|
return (
|
2023-12-05 01:22:44 +03:00
|
|
|
<label
|
2023-12-15 17:34:50 +03:00
|
|
|
className={clsx(
|
|
|
|
'text-sm font-semibold whitespace-nowrap',
|
|
|
|
className
|
|
|
|
)}
|
2023-12-05 01:22:44 +03:00
|
|
|
{...restProps}
|
|
|
|
>
|
|
|
|
{text}
|
|
|
|
</label>);
|
2023-07-15 17:46:19 +03:00
|
|
|
}
|
|
|
|
|
2023-12-15 17:34:50 +03:00
|
|
|
export default Label;
|