ConceptPortal-public/rsconcept/frontend/src/components/Common/Label.tsx

22 lines
471 B
TypeScript
Raw Normal View History

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-10-14 23:46:36 +03:00
function Label({ text, tooltip, className, ...props }: LabelProps) {
2023-07-15 17:46:19 +03:00
return (
2023-07-25 20:27:29 +03:00
<label
className={`text-sm font-semibold ${className}`}
2023-10-14 23:46:36 +03:00
title={tooltip}
{...props}
>
2023-10-14 23:46:36 +03:00
{text}
2023-07-15 17:46:19 +03:00
</label>
);
}
2023-07-25 20:27:29 +03:00
export default Label;