import { forwardRef } from 'react'; import { Flex } from '@chakra-ui/react'; import { useColorValue, useOpposingColor } from '~/hooks'; import type { FlexProps } from '@chakra-ui/react'; interface LabelProps extends FlexProps { value: string; label: string; bg: string; valueColor?: string; labelColor?: string; } const _Label: React.ForwardRefRenderFunction = ( props: LabelProps, ref, ) => { const { value, label, labelColor, bg = 'primary.600', valueColor, ...rest } = props; const valueColorAuto = useOpposingColor(bg); const defaultLabelColor = useColorValue('blackAlpha.700', 'whiteAlpha.700'); return ( {value} {label} ); }; export const Label = forwardRef(_Label);