import * as React from 'react'; import { Flex, FormControl, FormLabel, FormErrorMessage, useColorMode } from '@chakra-ui/core'; const labelColor = { dark: 'whiteAlpha.700', light: 'blackAlpha.700' }; export const FormField = ({ label, name, error, hiddenLabels, helpIcon, targetInfo, setTarget, labelAddOn, fieldAddOn, children, ...props }) => { const { colorMode } = useColorMode(); return ( {label} {labelAddOn || null} {children} {fieldAddOn && ( {fieldAddOn} )} {error && error.message} ); };