msgba-web/js-src/components/form-select-files.tsx

28 lines
928 B
TypeScript

import * as React from 'react';
export interface FormSelectFilesProps {
refInputRom: React.RefObject<HTMLInputElement>;
refInputSaveState: React.RefObject<HTMLInputElement>;
onStartEmulation: React.MouseEventHandler<HTMLInputElement>;
}
export default function FormSelectFiles(props: FormSelectFilesProps) {
const inputRom = props.refInputRom ? props.refInputRom : React.useRef(null);
const inputSaveState = props.refInputSaveState ? props.refInputSaveState : React.useRef(null);
const onStartEmulation = props.onStartEmulation;
return (
<form>
<label htmlFor="rom">
Rom file
<input type="file" ref={inputRom} name="rom"/>
</label>
<label htmlFor="savestate">
Savestate (A ss file from mgba...)
<input type="file" ref={inputSaveState} name="savestate"/>
</label>
<input type="button" value="Start emulation" onClick={onStartEmulation}/>
</form>
);
}