import { type FC } from 'react'; import { StyleSheet, View } from 'react-native'; import TTypography from '../TTypography/TTypography'; import { TypographyVariant } from '../TTypography/TTypographyEnum'; import { withTheme, useTheme } from '../../core/theming'; import type { Theme } from '../../utils/types'; interface LabelProps { title: string; variant: | 'Successful' | 'Failed' | 'Active' | 'Resolved' | 'Cancelled' | 'Initiated'; backgroundColor?: string; theme: Theme; testID?: string; accessibilityLabel?: string; } const TTag: FC = ({ title, variant, backgroundColor, testID, accessibilityLabel, }): any => { const { colors } = useTheme(); function getLabelBackgroundColor( status: | 'Successful' | 'Failed' | 'Active' | 'Resolved' | 'Cancelled' | 'Initiated' ) { switch (status) { case 'Successful': return colors.transactionSuccess; case 'Failed': return colors.transactionFailure; case 'Active': case 'Initiated': return colors.primaryYellowShade; case 'Resolved': return colors.successTwo; case 'Cancelled': return colors.neutralGray; default: return colors.white; } } return ( {title} ); }; export default withTheme(TTag); const tagStyles = StyleSheet.create({ container: { alignItems: 'flex-start', }, label: { lineHeight: 14, paddingVertical: 4, paddingHorizontal: 6, borderRadius: 4, overflow: 'hidden', }, });