import { type ReactNode } from 'react'; import { FadeIn, FadeOut } from 'react-native-reanimated'; import { isTranslationKey, useTranslate } from '@suite-native/intl'; import { AnimatedView } from '../Animated/AnimatedView'; import { Box } from '../Box'; import { Hint } from '../Hint'; import { VStack } from '../Stack'; import { Text } from '../Text'; export type InputWrapperProps = { children: ReactNode; label?: ReactNode; hint?: string; error?: string; }; export const InputWrapper = ({ children, label, hint, error }: InputWrapperProps) => { const { translate } = useTranslate(); const errorMessage = isTranslationKey(error) ? translate(error) : error; return ( {!!label && ( {label} )} {children} {(!!error || !!hint) && ( {!!error && ( {errorMessage} )} {!!hint && ( {hint} )} )} ); };