import React, { FC } from "react"; import { Box, Flex, Stack, useRadio, UseRadioProps } from "@chakra-ui/react"; export type RadioCardProps = React.PropsWithChildren<{ helpText?: string; disabled?: boolean; } & UseRadioProps>; export const RadioCard: FC = ({ children, disabled = false, ...props }) => { const { getInputProps, getCheckboxProps } = useRadio(props); const input = getInputProps(); const checkbox = getCheckboxProps(); return ( { if (disabled) { e.preventDefault(); e.stopPropagation(); } }} > {/* @ts-ignore */} {children} ); }; export const RadioCardWithAffordance: FC = ({ children, disabled = false, ...props }) => { const { getInputProps, getCheckboxProps } = useRadio(props); const input = getInputProps(); const checkbox = getCheckboxProps(); return ( { if (disabled) { e.preventDefault(); e.stopPropagation(); } }} > {/* @ts-ignore */} {children} ); };