import React, { forwardRef, InputHTMLAttributes } from "react"; import classNames from "@calcom/lib/classNames"; type Props = InputHTMLAttributes & { label?: React.ReactNode; description: string; descriptionAsLabel?: boolean; informationIconText?: string; error?: boolean; }; const CheckboxField = forwardRef( ({ label, description, error, informationIconText, disabled, ...rest }, ref) => { const descriptionAsLabel = !label || rest.descriptionAsLabel; return (
{label && (
{React.createElement( descriptionAsLabel ? "div" : "label", { className: classNames("flex text-sm font-medium text-gray-900"), ...(!descriptionAsLabel ? { htmlFor: rest.id, } : {}), }, label )}
)}
{React.createElement( descriptionAsLabel ? "label" : "div", { className: classNames( "relative flex items-start", !error && descriptionAsLabel ? "text-gray-900" : "text-neutral-900", error && "text-red-800" ), }, <>
{description} )} {/* {informationIconText && } */}
); } ); CheckboxField.displayName = "CheckboxField"; export default CheckboxField;