import React, { HTMLProps } from "react"; import classNames from "classnames"; import { useId } from "@reach/auto-id"; import { Box } from "../Box"; import { Input } from "../Input"; import { Text } from "../Text"; import { Icon, ICON_TYPE } from "../Icon"; import { bem } from "../../utilities/bem"; import isUndefined from "../../utilities/isUndefined"; const cn = "OptionButton"; interface OptionButtonProps extends HTMLProps { heading: string; description?: string; } export const OptionButton = (props: OptionButtonProps) => { const { heading, description, id: idProp, checked, className, defaultValue, ...rest } = props; const fallbackId = `OptionButton:${useId()}`; const id = isUndefined(idProp) ? fallbackId : idProp; return ( {heading && ( {heading} )} {description && ( {description} )} Selected ); };