import React from 'react' import {Pressable, StyleProp, View, ViewStyle} from 'react-native' import {ComAtprotoLabelDefs} from '@atproto/api' import {Text} from '../text/Text' import {usePalette} from 'lib/hooks/usePalette' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useModalControls} from '#/state/modals' export function LabelInfo({ details, labels, style, }: { details: {did: string} | {uri: string; cid: string} labels: ComAtprotoLabelDefs.Label[] | undefined style?: StyleProp }) { const pal = usePalette('default') const {_} = useLingui() const {openModal} = useModalControls() if (!labels) { return null } labels = labels.filter(l => !l.val.startsWith('!')) if (!labels.length) { return null } return ( This {'did' in details ? 'account' : 'post'} has been labeled. {' '} openModal({name: 'appeal-label', ...details})}> Appeal this decision. ) }