import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import { Fragment } from 'react' import { Trans, useTranslation } from 'react-i18next' import { Pressable, View, ViewStyle } from 'react-native' import Icon from './Icon' import CustomText from './Text' export type Props = { onPress: () => void filter: Mastodon.Filter<'v2'> button?: React.ReactNode style?: ViewStyle } export const Filter: React.FC = ({ onPress, filter, button, style }) => { const { t } = useTranslation(['common', 'screenTabs']) const { colors } = useTheme() return ( {filter.expires_at && new Date() > new Date(filter.expires_at) ? ( ) : null} {filter.keywords?.length ? ( ) : null} {filter.keywords?.length && filter.statuses?.length ? ( ) : null} {filter.statuses?.length ? ( ) : null} {filter.context.map((c, index) => ( ))} ]} /> } /> {button || ( )} ) }