import { FormattedMessage } from 'react-intl'; import { useParams } from 'react-router'; import { Link } from 'react-router-dom'; import ElephantDarkImage from '@/images/elephant_ui_dark.svg?react'; import ElephantLightImage from '@/images/elephant_ui_light.svg?react'; import { EmptyState } from '@/mastodon/components/empty_state'; import { LimitedAccountHint } from '@/mastodon/features/account_timeline/components/limited_account_hint'; import { areCollectionsEnabled } from '@/mastodon/features/collections/utils'; import { useCurrentAccountId } from '@/mastodon/hooks/useAccountId'; import { useTheme } from '@/mastodon/hooks/useTheme'; interface EmptyMessageProps { suspended: boolean; hidden: boolean; blockedBy: boolean; accountId?: string; } export const EmptyMessage: React.FC = ({ accountId, suspended, hidden, blockedBy, }) => { const { acct } = useParams<{ acct?: string }>(); const me = useCurrentAccountId(); const theme = useTheme(); const ElephantImage = theme === 'dark' ? ElephantDarkImage : ElephantLightImage; if (!accountId) { return null; } let title: React.ReactNode = null; let message: React.ReactNode = null; const hasCollections = areCollectionsEnabled(); const image = ; if (me === accountId) { if (hasCollections) { // Return only here to insert the "Create a collection" button as the action for the empty state. return ( } > ); } else { title = ( ); message = ( ); } } else if (suspended) { title = ( ); } else if (hidden) { message = ; } else if (blockedBy) { title = ( ); } else { // Standard other account empty state. title = ( ); if (hasCollections) { if (acct) { message = ( ); } else { message = ( ); } } else { if (acct) { message = ( ); } else { message = ( ); } } } return ; };