mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at tooltip 55 lines 1.6 kB view raw
1import {useMemo} from 'react' 2import {View} from 'react-native' 3import {msg} from '@lingui/macro' 4import {useLingui} from '@lingui/react' 5 6import {LINEAR_AVI_WIDTH, OUTER_SPACE} from '#/screens/PostThread/const' 7import {atoms as a, useTheme} from '#/alf' 8import {PersonX_Stroke2_Corner0_Rounded as PersonXIcon} from '#/components/icons/Person' 9import {Trash_Stroke2_Corner0_Rounded as TrashIcon} from '#/components/icons/Trash' 10import {Text} from '#/components/Typography' 11 12export type ThreadItemPostTombstoneProps = { 13 type: 'not-found' | 'blocked' 14} 15 16export function ThreadItemPostTombstone({type}: ThreadItemPostTombstoneProps) { 17 const t = useTheme() 18 const {_} = useLingui() 19 const {copy, Icon} = useMemo(() => { 20 switch (type) { 21 case 'blocked': 22 return {copy: _(msg`Post blocked`), Icon: PersonXIcon} 23 case 'not-found': 24 default: 25 return {copy: _(msg`Post not found`), Icon: TrashIcon} 26 } 27 }, [_, type]) 28 29 return ( 30 <View 31 style={[ 32 a.mb_xs, 33 { 34 paddingHorizontal: OUTER_SPACE, 35 paddingTop: OUTER_SPACE / 1.2, 36 }, 37 ]}> 38 <View 39 style={[ 40 a.flex_row, 41 a.align_center, 42 a.rounded_sm, 43 t.atoms.bg_contrast_25, 44 {paddingVertical: OUTER_SPACE / 1.2}, 45 ]}> 46 <View style={[a.flex_row, a.justify_center, {width: LINEAR_AVI_WIDTH}]}> 47 <Icon style={[t.atoms.text_contrast_medium]} /> 48 </View> 49 <Text style={[a.text_md, a.font_bold, t.atoms.text_contrast_medium]}> 50 {copy} 51 </Text> 52 </View> 53 </View> 54 ) 55}