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

28 lines
928 B
TypeScript
Raw Normal View History

2023-03-22 13:53:16 +01:00
import * as React from 'react';
2023-03-19 20:05:33 +01:00
2023-03-22 13:53:16 +01:00
export interface FormSelectFilesProps {
refInputRom: React.RefObject<HTMLInputElement>;
refInputSaveState: React.RefObject<HTMLInputElement>;
onStartEmulation: React.MouseEventHandler<HTMLInputElement>;
}
export default function FormSelectFiles(props: FormSelectFilesProps) {
2023-03-19 20:05:33 +01:00
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>
2023-03-22 13:53:16 +01:00
<input type="button" value="Start emulation" onClick={onStartEmulation}/>
2023-03-19 20:05:33 +01:00
</form>
);
}