import {View} from 'react-native' import {type ChatBskyActorDefs} from '@atproto/api' import {useLingui} from '@lingui/react/macro' import {makeProfileLink} from '#/lib/routes/links' import {type ConvoItem} from '#/state/messages/convo/types' import {useInviteLinkDialog} from '#/screens/Messages/components/InviteLinkDialogProvider' import {atoms as a, useTheme} from '#/alf' import {Button} from '#/components/Button' import {getSystemMessageInfo} from '#/components/dms/getSystemMessageInfo' import {Link} from '#/components/Link' import {Text} from '#/components/Typography' export function SystemMessageItem({ item, relatedProfiles, }: { item: ConvoItem & {type: 'system-message'} relatedProfiles: Map }) { const t = useTheme() const {i18n, t: l} = useLingui() const inviteLinkControl = useInviteLinkDialog() const info = getSystemMessageInfo(item.message.data, relatedProfiles) if (!info) return null const {Icon, action} = info const text = i18n._(info.message) const row = ( {text} ) switch (action?.kind) { case 'profile': return ( {row} ) case 'inviteLink': if (!inviteLinkControl) return row return ( ) default: return row } }