import {type StyleProp, View, type ViewStyle} from 'react-native' import {AtUri} from '@atproto/api' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {cleanError} from '#/lib/strings/errors' import {isNative, isWeb} from '#/platform/detection' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {getFeedTypeFromUri} from '#/state/queries/feed' import {useProfileQuery} from '#/state/queries/profile' import {atoms as a, useTheme, web} from '#/alf' import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import {Divider} from '#/components/Divider' import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons/Warning' import * as ProfileCard from '#/components/ProfileCard' import {Text} from '#/components/Typography' export function MissingFeed({ style, hideTopBorder, uri, error, }: { style?: StyleProp hideTopBorder?: boolean uri: string error?: unknown }) { const t = useTheme() const {_} = useLingui() const control = Dialog.useDialogControl() const type = getFeedTypeFromUri(uri) return ( <> ) } function DialogInner({ uri, type, error, }: { uri: string type: 'feed' | 'list' error: unknown }) { const control = Dialog.useDialogContext() const t = useTheme() const {_} = useLingui() const atUri = new AtUri(uri) const {data: profile, isError: isProfileError} = useProfileQuery({ did: atUri.host, }) const moderationOpts = useModerationOpts() return ( {type === 'feed' ? ( Could not connect to feed service ) : ( Deleted list )} {type === 'feed' ? ( We could not connect to the service that provides this custom feed. It may be temporarily unavailable and experiencing issues, or permanently unavailable. ) : ( We could not find this list. It was probably deleted. )} {type === 'feed' ? ( Feed creator ) : ( List creator )} {profile && moderationOpts && ( control.close()}> )} {isProfileError && ( Could not find profile )} {type === 'feed' && ( <> Feed identifier {atUri.rkey} )} {error instanceof Error && ( <> Error message {cleanError(error.message)} )} {isNative && ( )} ) }