import type { FC, ReactNode } from 'react'; import { FormattedMessage } from 'react-intl'; import { LimitedAccountHint } from '@/mastodon/features/account_timeline/components/limited_account_hint'; import { useAccountVisibility } from '@/mastodon/hooks/useAccountVisibility'; import type { Account } from '@/mastodon/models/account'; import { RemoteHint } from './remote'; interface BaseEmptyMessageProps { account?: Account; defaultMessage: ReactNode; } export type EmptyMessageProps = Omit; export const BaseEmptyMessage: FC = ({ account, defaultMessage, }) => { const { blockedBy, hidden, suspended } = useAccountVisibility(account?.id); if (!account) { return null; } if (suspended) { return ( ); } if (hidden) { return ; } if (blockedBy) { return ( ); } if (account.hide_collections) { return ( ); } const domain = account.acct.split('@')[1]; if (domain) { return ; } return defaultMessage; };