import type { FC } from '../../../lib/teact/teact'; import React, { memo, useCallback, useState } from '../../../lib/teact/teact'; import { LeftColumnContent } from '../../../types'; import { LAYERS_ANIMATION_NAME } from '../../../util/windowEnvironment'; import Transition from '../../ui/Transition'; import NewChatStep1 from './NewChatStep1'; import NewChatStep2 from './NewChatStep2'; import './NewChat.scss'; export type OwnProps = { isActive: boolean; isChannel?: boolean; content: LeftColumnContent; onContentChange: (content: LeftColumnContent) => void; onReset: () => void; }; const RENDER_COUNT = Object.keys(LeftColumnContent).length / 2; const NewChat: FC = ({ isActive, isChannel = false, content, onContentChange, onReset, }) => { const [newChatMemberIds, setNewChatMemberIds] = useState([]); const handleNextStep = useCallback(() => { onContentChange(isChannel ? LeftColumnContent.NewChannelStep2 : LeftColumnContent.NewGroupStep2); }, [isChannel, onContentChange]); return ( {(isStepActive) => { switch (content) { case LeftColumnContent.NewChannelStep1: case LeftColumnContent.NewGroupStep1: return ( ); case LeftColumnContent.NewChannelStep2: case LeftColumnContent.NewGroupStep2: return ( ); default: return undefined; } }} ); }; export default memo(NewChat);