import { useMachine } from '@xstate/react'; import { Table, Button, Progress, Alert } from 'antd'; import { shell } from 'electron'; import { DownloadOutlined, PlaySquareOutlined, ClearOutlined, GithubOutlined, EyeOutlined, FormatPainterOutlined, RedoOutlined, } from '@ant-design/icons'; import fsm from './fsm'; import './App.less'; function App() { const [state, send] = useMachine(fsm); const { captureList, currentUrl, downloadProgress } = state.context; return (
{state.matches('检测初始化') ?
检测中……
: null} {state.matches('初始化完成') ? (
value, ellipsis: true, }, { title: '大小', dataIndex: 'prettySize', key: 'prettySize', width: '100px', render: value => value, }, { title: '操作', dataIndex: 'action', key: 'action', width: '210px', render: (_, { url, decodeKey, hdUrl, fixUrl, description, fullFileName }) => (
{fullFileName ? ( ) : ( )}
), }, ]} pagination={{ position: ['none', 'none'] }} >
{state.matches('初始化完成.预览') ? (
{ e.target == e.currentTarget && send('e_关闭'); }} >
) : null} {state.matches('初始化完成.下载.下载中') ? (
) : null}
) : null} {state.matches('未初始化') ? (
  
) : null} {state.matches('开启服务失败') ? (
) : null}
); } export default App;