"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SidePanel = void 0;
var react_1 = __importDefault(require("react"));
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var ErrorBoundary_1 = require("../ErrorBoundary");
var EmptyState_1 = require("../EmptyState");
var styles_1 = require("./styles");
var SidePanel = function (_a) {
    var width = _a.width, open = _a.open, children = _a.children;
    var styles = (0, styles_1.useStyles)();
    return (react_1.default.createElement("div", { className: styles.contentWrapper, "data-reltio-id": "side-panel", style: {
            width: width ? "".concat(open ? width : 0, "px") : '100%'
        } },
        react_1.default.createElement(ErrorBoundary_1.ErrorBoundary, { error: react_1.default.createElement(EmptyState_1.EmptyState, { LogoRenderer: EmptyState_1.EMPTY_STATE_ICONS.ERROR, text: ui_i18n_1.default.text('Something went wrong'), variant: EmptyState_1.EMPTY_STATE_VARIANTS.full }) }, open && children)));
};
exports.SidePanel = SidePanel;
