Something went wrong. Try again.
Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
1.9 kB · 59 lines
TSX
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960import {useMemo} from 'react'import {View} from 'react-native'import {msg} from '@lingui/macro'import {useLingui} from '@lingui/react'
import {getTerminology, TERMINOLOGY} from '#/lib/strings/terminology'import {useTerminologyPreference} from '#/state/preferences'import {LINEAR_AVI_WIDTH, OUTER_SPACE} from '#/screens/PostThread/const'import {atoms as a, useTheme} from '#/alf'import {PersonX_Stroke2_Corner0_Rounded as PersonXIcon} from '#/components/icons/Person'import {Trash_Stroke2_Corner0_Rounded as TrashIcon} from '#/components/icons/Trash'import {Text} from '#/components/Typography'
export type ThreadItemPostTombstoneProps = { type: 'not-found' | 'blocked'}
export function ThreadItemPostTombstone({type}: ThreadItemPostTombstoneProps) { const t = useTheme() const {_} = useLingui() const terminologyPreference = useTerminologyPreference() const {copy, Icon} = useMemo(() => { switch (type) { case 'blocked': return {copy: _(getTerminology(terminologyPreference, TERMINOLOGY.blocked)), Icon: PersonXIcon} case 'not-found': default: return {copy: _(getTerminology(terminologyPreference, TERMINOLOGY.notFound)), Icon: TrashIcon} } }, [_, type, terminologyPreference])
return ( <View style={[ a.mb_xs, { paddingHorizontal: OUTER_SPACE, paddingTop: OUTER_SPACE / 1.2, }, ]}> <View style={[ a.flex_row, a.align_center, a.rounded_sm, t.atoms.bg_contrast_25, {paddingVertical: OUTER_SPACE / 1.2}, ]}> <View style={[a.flex_row, a.justify_center, {width: LINEAR_AVI_WIDTH}]}> <Icon style={[t.atoms.text_contrast_medium]} /> </View> <Text style={[a.text_md, a.font_semi_bold, t.atoms.text_contrast_medium]}> {copy} </Text> </View> </View> )}