import React, { useContext } from 'react'; import { Result, Button } from 'antd'; import Context from '../UIApiContext'; import styles from './ResultPanel.module.less'; export default ({ name, onFinish }: { name: string; url: string; onFinish: () => void }) => { const { api } = useContext(Context); const { intl } = api; // const [alive, setAlive] = useState(false); // const isMini = api.isMini(); // useEffect(() => { // (async () => { // const msg = (await api.callRemote({ // type: 'tasks/is_dev_server_alive', // })) as { // alive: boolean; // }; // setAlive(msg.alive); // })(); // }, []); return (
onFinish()}> {intl({ id: 'org.umi.ui.blocks.adder.result.done' })} // isMini || !alive // ? [ // , // ] // : [ // , // ] } />
); };