import React from 'react';
import i18n from 'ui-i18n';
import Button from '@mui/material/Button';
import { IMAGE_TYPES } from '../../constants';
export var SelectImageButton = function (_a) {
    var className = _a.className, onAppendFile = _a.onAppendFile;
    var handleInput = function (e) {
        if (onAppendFile) {
            onAppendFile(e.currentTarget.files[0]);
        }
    };
    return (React.createElement(React.Fragment, null,
        React.createElement("input", { onInput: handleInput, style: { display: 'none' }, accept: IMAGE_TYPES.join(','), id: "upload-image-button", "data-reltio-id": "upload-image-button", type: "file" }),
        React.createElement("label", { htmlFor: "upload-image-button" },
            React.createElement(Button, { className: className, variant: "contained", color: "primary", component: "span" }, i18n.text('Select image')))));
};
