fuzzyworld

dao-game / react-multiplayer / files / src / react / Controls.tsx

Branch react-multiplayer · default branch · all branches

Controls.tsx

Blame: the commit that last changed each line · file · history

417dc266 2022-03-23 Pavel Safronov1import * as React from 'react';
2import './Controls.css';
3
4export type Props = {
5 isDisabled: boolean
6 onUndo: () => void
7};
8
9const reload = () => location.reload();
10
11export const Controls = (props: Props): React.ReactElement => {
12 const { isDisabled, onUndo } = props;
13 return <div className='container'>
14 <div className='controls'>
15 <button
16 disabled={isDisabled}
17 type='button'
18 onClick={onUndo}
19 className='undo-button'>Undo</button>
20 <button
21 disabled={isDisabled}
22 type='button'
23 onClick={reload}
24 className='reset-button'>Reset</button>
25 </div>
26 </div>;
27}