import type { InputHTMLAttributes } from "react"; import React, { forwardRef } from "react"; import classNames from "@calcom/lib/classNames"; type Props = InputHTMLAttributes & { label?: React.ReactNode; description: string; descriptionAsLabel?: boolean; informationIconText?: string; error?: boolean; className?: string; }; const CheckboxField = forwardRef( ({ label, description, error, 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-gray-900", error && "text-red-800" ), }, <>
{description} )} {/* {informationIconText && } */}
); } ); CheckboxField.displayName = "CheckboxField"; export default CheckboxField;