"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectImageButton = void 0;
var react_1 = __importDefault(require("react"));
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var Button_1 = __importDefault(require("@mui/material/Button"));
var constants_1 = require("../../constants");
var SelectImageButton = function (_a) {
    var className = _a.className, onAppendFile = _a.onAppendFile;
    var handleInput = function (e) {
        if (onAppendFile) {
            onAppendFile(e.currentTarget.files[0]);
        }
    };
    return (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement("input", { onInput: handleInput, style: { display: 'none' }, accept: constants_1.IMAGE_TYPES.join(','), id: "upload-image-button", "data-reltio-id": "upload-image-button", type: "file" }),
        react_1.default.createElement("label", { htmlFor: "upload-image-button" },
            react_1.default.createElement(Button_1.default, { className: className, variant: "contained", color: "primary", component: "span" }, ui_i18n_1.default.text('Select image')))));
};
exports.SelectImageButton = SelectImageButton;
