import { SearchOutlined } from '@ant-design/icons'; import { Input, Table, Tag } from 'antd'; import _ from 'lodash'; import React from 'react'; import './index.less'; import KeyMapConfig from './keymap'; const ShortCuts: React.FC<{ intl: any }> = ({ intl }) => { const [dataList, setDataList] = React.useState(KeyMapConfig); const columns = [ { title: 'Scope', dataIndex: 'scope', key: 'scope', width: 160 }, { title: 'Action', dataIndex: 'command', key: 'command', render: (text: string, row: any) => { return {intl.formatMessage({ id: text })}; } }, { title: 'Keybinding', dataIndex: 'keybinding', key: 'keybinding', width: 180, render: (text: string, row: any) => { return {row.keybinding}; } } ]; const handleInputChange = (e: any) => { const value = e.target.value; const list = _.filter(KeyMapConfig, (item: any) => { return ( item.command.toLowerCase().includes(value.toLowerCase()) || item.scope.toLowerCase().includes(value.toLowerCase()) ); }); setDataList(list); }; const debounceHandleInputChange = _.debounce(handleInputChange, 300); return (

{intl.formatMessage({ id: 'shortcuts.title' })}

} > record.command} columns={columns} dataSource={dataList} pagination={false} scroll={{ y: 450 }} >
); }; export const modalConfig = { icon: null, centered: false, maskClosable: true, footer: null, style: { top: '10%' }, width: 700 }; export default React.memo(ShortCuts);