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