aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/game/apps/Gaming.jsx
blob: bf47860a921886619ed7e9b0cc88e229e6e85587 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export default ({ problem, onCodeChange, score }) => {
  const handleTextChange = (e) => {
    onCodeChange({ code: e.target.value });
  };

  return (
    <div style={{ display: 'flex' }}>
      <div style={{ flex: 1, padding: '10px', borderRight: '1px solid #ccc' }}>
        <div>
          {problem}
        </div>
        <div>
          {score == null ? 'Score: -' : `Score: ${score} byte`}
        </div>
      </div>
      <div style={{ flex: 1, padding: '10px' }}>
        <textarea
          style={{ width: '100%', height: '100%' }}
          onChange={handleTextChange}
        />
      </div>
    </div>
  );
};