import React from 'react'; import { Box, Flex, Grid, type GridProps, HStack } from '@chakra-ui/react'; import { useTranslation } from 'next-i18next'; import QuestionTip from '../MyTooltip/QuestionTip'; type Props = Omit & { list: { title: string; value: T; tooltip?: string; }[]; value: T; defaultBg?: string; activeBg?: string; onChange: (e: T) => void; }; const RadioGroup = ({ list, value, onChange, ...props }: Props) => { const { t } = useTranslation(); return ( {list.map((item) => ( onChange(item.value)} > {typeof item.title === 'string' ? t(item.title as any) : item.title} {!!item.tooltip && } ))} ); }; export default RadioGroup;