20 lines
431 B
TypeScript

import { FC, HTMLProps } from "react";
interface InputLabelProps extends HTMLProps<HTMLLabelElement> {
required?: boolean;
}
const InputLabel: FC<InputLabelProps> = (props) => {
return (
<label
htmlFor={props.id}
className="block text-sm font-medium text-gray-700"
>
{props.children}
{props.required && <span className="text-red-600">*</span>}
</label>
);
};
export default InputLabel;