import { Input } from 'antd'; import styles from './style.module.less'; import { useEffect, useState } from 'react'; import ChatItem from '../components/ChatItem'; import { MsgDataType } from '../common/type'; const { Search } = Input; const Chat = () => { const [inputMsg, setInputMsg] = useState(''); const [msg, setMsg] = useState(''); const [triggerResize, setTriggerResize] = useState(false); const [chatItemVisible, setChatItemVisible] = useState(false); const onWindowResize = () => { setTriggerResize(true); setTimeout(() => { setTriggerResize(false); }, 0); }; useEffect(() => { window.addEventListener('resize', onWindowResize); return () => { window.removeEventListener('resize', onWindowResize); }; }, []); const onInputChange = (e: React.ChangeEvent) => { const { value } = e.target; setInputMsg(value); }; const onSearch = () => { setMsg(inputMsg); setChatItemVisible(false); setTimeout(() => { setChatItemVisible(true); }, 200); }; const onMsgDataLoaded = (msgData: MsgDataType) => {}; //预发环境: 5: 查信息,6: 智能圈选,12:问指标,15:歌曲库,16:艺人库 return (
{msg && chatItemVisible && (
)}
); }; export default Chat;