import type { FC } from '../../lib/teact/teact'; import { memo } from '../../lib/teact/teact'; import type { ApiTopic } from '../../api/types'; import type { OldLangFn } from '../../hooks/useOldLang'; import type { MessageListType } from '../../types'; import { REM } from '../common/helpers/mediaDimensions'; import renderText from '../common/helpers/renderText'; import useOldLang from '../../hooks/useOldLang'; import Icon from '../common/icons/Icon'; import TopicIcon from '../common/TopicIcon'; import './NoMessages.scss'; const ICON_SIZE = 3 * REM; type OwnProps = { chatId: string; isChatWithSelf?: boolean; type: MessageListType; isGroupChatJustCreated?: boolean; topic?: ApiTopic; }; const NoMessages: FC = ({ isChatWithSelf, type, isGroupChatJustCreated, topic, }) => { const lang = useOldLang(); if (type === 'scheduled') { return renderScheduled(lang); } if (isChatWithSelf) { return renderSavedMessages(lang); } if (isGroupChatJustCreated) { return renderGroup(lang); } if (topic) { return renderTopic(lang, topic); } return (
{lang('NoMessages')}
); }; function renderTopic(lang: OldLangFn, topic: ApiTopic) { return (

{lang('Chat.EmptyTopicPlaceholder.Title')}

{renderText(lang('Chat.EmptyTopicPlaceholder.Text'), ['br'])}

); } function renderScheduled(lang: OldLangFn) { return (
{lang('ScheduledMessages.EmptyPlaceholder')}
); } function renderSavedMessages(lang: OldLangFn) { return (

{lang('Conversation.CloudStorageInfo.Title')}

  • {lang('Conversation.ClousStorageInfo.Description1')}
  • {lang('Conversation.ClousStorageInfo.Description2')}
  • {lang('Conversation.ClousStorageInfo.Description3')}
  • {lang('Conversation.ClousStorageInfo.Description4')}
); } function renderGroup(lang: OldLangFn) { return (

{lang('EmptyGroupInfo.Title')}

{lang('EmptyGroupInfo.Subtitle')}

  • {lang('EmptyGroupInfo.Line1')}
  • {lang('EmptyGroupInfo.Line2')}
  • {lang('EmptyGroupInfo.Line3')}
  • {lang('EmptyGroupInfo.Line4')}
); } export default memo(NoMessages);