mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
Add InputBox component
This commit is contained in:
parent
95c8ae8780
commit
a100cbef4f
2 changed files with 61 additions and 8 deletions
|
|
@ -58,8 +58,6 @@ export default function ({ vmParts: { file, engine } }) {
|
|||
const [inputType, setInputType] = useState(null)
|
||||
const [inbox, setInbox] = useState([])
|
||||
|
||||
const [messages, setMessages] = useState([])
|
||||
|
||||
const [vm, setVm] = useState(null)
|
||||
const [sendMessage, setSendMessage] = useState(null)
|
||||
|
||||
|
|
@ -86,10 +84,6 @@ export default function ({ vmParts: { file, engine } }) {
|
|||
: null)
|
||||
}, [vm])
|
||||
|
||||
useEffect(() => {
|
||||
window.send = x => sendMessage(x, currentWindow)
|
||||
}, [sendMessage, currentWindow])
|
||||
|
||||
return status.stage !== 'ready'
|
||||
? (<div>{status.details}</div>)
|
||||
: (<section>
|
||||
|
|
@ -97,6 +91,10 @@ export default function ({ vmParts: { file, engine } }) {
|
|||
inbox,
|
||||
currentWindow
|
||||
}}/>
|
||||
<InputBox/>
|
||||
<InputBox {...{
|
||||
currentWindow,
|
||||
inputType,
|
||||
sendMessage
|
||||
}}/>
|
||||
</section>)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue