1 import React from 'react';
2 import { Button } from 'react-bootstrap';
3 import { withTranslation } from 'react-i18next';
5 import i18n from '../../i18n';
7 import { useAlttpBaseRom } from '../../helpers/AlttpBaseRomContext';
9 const BaseRomButton = () => {
10 const { rom, setRom } = useAlttpBaseRom();
12 const handleFile = React.useCallback(async e => {
13 if (e.target.files.length != 1) {
16 const buf = await e.target.files[0].arrayBuffer();
31 <label htmlFor="alttp.baseRom">
32 <Button as="span" variant="primary">
33 {i18n.t('alttp.setBaseRom')}
39 export default withTranslation()(BaseRomButton);