"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageGalleryDialog = void 0;
var react_1 = __importStar(require("react"));
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var Dialog_1 = __importDefault(require("@mui/material/Dialog"));
var DialogContent_1 = __importDefault(require("@mui/material/DialogContent"));
var AppBar_1 = __importDefault(require("@mui/material/AppBar"));
var Toolbar_1 = __importDefault(require("@mui/material/Toolbar"));
var Box_1 = __importDefault(require("@mui/material/Box"));
var Close_1 = __importDefault(require("@mui/icons-material/Close"));
var ViewCompact_1 = __importDefault(require("@mui/icons-material/ViewCompact"));
var Details_1 = __importDefault(require("../icons/Details"));
var SmallIconButton_1 = require("../SmallIconButton");
var ModeSwitcher_1 = require("../ModeSwitcher");
var constants_1 = require("./constants");
var styles_1 = require("./styles");
var ImageGalleryDialog = function (_a) {
    var open = _a.open, mode = _a.mode, children = _a.children, header = _a.header, onClose = _a.onClose, onChangeMode = _a.onChangeMode;
    var styles = (0, styles_1.useStyles)();
    var modes = (0, react_1.useMemo)(function () { return [
        {
            id: constants_1.ImageGalleryMode.Gallery,
            title: ui_i18n_1.default.text('Gallery'),
            Icon: ViewCompact_1.default
        },
        {
            id: constants_1.ImageGalleryMode.Details,
            title: ui_i18n_1.default.text('Details'),
            Icon: Details_1.default
        }
    ]; }, []);
    return (react_1.default.createElement(Dialog_1.default, { classes: { paper: styles.paper }, open: open, BackdropProps: { className: styles.backdrop }, fullScreen: true },
        react_1.default.createElement(AppBar_1.default, { classes: { colorPrimary: styles.appBar } },
            react_1.default.createElement(Toolbar_1.default, { className: styles.toolbar },
                react_1.default.createElement(Box_1.default, { className: styles.headerLeft },
                    react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { tooltipTitle: ui_i18n_1.default.text('Close'), onClick: onClose, className: styles.closeButton, iconClassName: styles.closeIcon, icon: Close_1.default }), header === null || header === void 0 ? void 0 :
                    header.left),
                react_1.default.createElement(Box_1.default, { className: styles.headerCenter },
                    react_1.default.createElement(ModeSwitcher_1.ModeSwitcher, { modes: modes, modeId: mode, onChange: onChangeMode, className: styles.modeSwitcher })),
                react_1.default.createElement(Box_1.default, { className: styles.headerRight }, header === null || header === void 0 ? void 0 : header.right))),
        react_1.default.createElement(DialogContent_1.default, { className: styles.content }, children)));
};
exports.ImageGalleryDialog = ImageGalleryDialog;
