modified CodeEditor
This commit is contained in:
parent
e9f95a333d
commit
cc8d35b7c7
2 changed files with 6 additions and 55 deletions
|
|
@ -2,7 +2,6 @@ import React, { useState } from 'react';
|
|||
|
||||
export default function PreviewPanel({ code }) {
|
||||
const [gameUrl, setGameUrl] = useState('');
|
||||
const [snakeApiUrl, setSnakeApiUrl] = useState('');
|
||||
const [settings, setSettings] = useState(null);
|
||||
const [moveRes, setMoveRes] = useState(null);
|
||||
const [loadingSetup, setLoadingSetup] = useState(false);
|
||||
|
|
@ -64,20 +63,6 @@ export default function PreviewPanel({ code }) {
|
|||
</button>
|
||||
</form>
|
||||
|
||||
{/* API server URL */}
|
||||
<form style={{ display: 'flex', gap: '0.5rem', marginBottom: '1rem' }}>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Your Snake API URL"
|
||||
value={snakeApiUrl}
|
||||
onChange={(e) => setSnakeApiUrl(e.target.value)}
|
||||
style={{ flex: 1 }}
|
||||
/>
|
||||
<button onClick={fetchSetup} disabled={!snakeApiUrl || loadingSetup}>
|
||||
{loadingSetup ? 'Loading…' : 'Connect Snake API'}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{/* Test Move */}
|
||||
<div style={{ marginBottom: '1rem' }}>
|
||||
<button onClick={testMove} disabled={!settings || loadingMove}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue