import React, { memo } from '../../lib/teact/teact'; import type { FC } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import useLang from '../../hooks/useLang'; import useHistoryBack from '../../hooks/useHistoryBack'; import useLeftHeaderButtonRtlForumTransition from './main/hooks/useLeftHeaderButtonRtlForumTransition'; import useShowTransition from '../../hooks/useShowTransition'; import useForumPanelRender from '../../hooks/useForumPanelRender'; import Button from '../ui/Button'; import ChatList from './main/ChatList'; import ForumPanel from './main/ForumPanel'; import './ArchivedChats.scss'; export type OwnProps = { isActive: boolean; onReset: () => void; onTopicSearch: NoneToVoidFunction; isForumPanelOpen?: boolean; }; const ArchivedChats: FC = ({ isActive, isForumPanelOpen, onReset, onTopicSearch, }) => { const lang = useLang(); useHistoryBack({ isActive, onBack: onReset, }); const { shouldDisableDropdownMenuTransitionRef, handleDropdownMenuTransitionEnd, } = useLeftHeaderButtonRtlForumTransition(isForumPanelOpen); const { shouldRender: shouldRenderTitle, transitionClassNames: titleClassNames, } = useShowTransition(!isForumPanelOpen); const { shouldRenderForumPanel, handleForumPanelAnimationEnd } = useForumPanelRender(isForumPanelOpen); return (
{lang.isRtl &&
} {shouldRenderTitle &&

{lang('ArchivedChats')}

}
{shouldRenderForumPanel && ( )}
); }; export default memo(ArchivedChats);