import { Trans } from 'react-i18next'; import React from 'react'; import type { TextProps as RNTextProps } from 'react-native'; import { Text, TextProps } from '../Text'; import type { Theme } from '../../theme/theme'; import './i18n'; type AllTextProps = TextProps & RNTextProps; interface ITransText extends AllTextProps { i18nKey: string; defaultValue?: string; values?: Record; childrenProps?: AllTextProps; } /** * Return an `Text` component with the `i18nKey` translated. * @i18nKey - i18n key * @values - values to be replaced in i18n keys * @defaultValue - default value to be shown if i18n key is not found * @childrenProps - props to be passed to Trans children component * @example * null, }} {textProps} /> **/ export const TransWithFormat = ({ i18nKey, defaultValue, values, childrenProps, ...textParams }: ITransText) => { return ( ), 1: , }} /> ); };