import React, { useState } from 'react'; import { Mentions } from 'antd'; const { Option } = Mentions; const MOCK_DATA = { '@': ['afc163', 'zombiej', 'yesmeck'], '#': ['1.0', '2.0', '3.0'], }; type PrefixType = keyof typeof MOCK_DATA; const App: React.FC = () => { const [prefix, setPrefix] = useState('@'); const onSearch = (_: string, newPrefix: PrefixType) => { setPrefix(newPrefix); }; return ( {(MOCK_DATA[prefix] || []).map(value => ( ))} ); }; export default App;