"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BWBottomSheetHeader = exports.BWBottomSheetFooter = void 0;
const ui_1 = require("@roomstay/ui");
const classnames_1 = __importDefault(require("classnames"));
const react_1 = __importDefault(require("react"));
const react_i18next_1 = require("react-i18next");
const react_spring_bottom_sheet_1 = require("react-spring-bottom-sheet");
const Translation_1 = require("../../../../translations/Translation");
const BEButton_1 = __importDefault(require("../../BEButton"));
const BookingWizard_1 = require("../BookingWizard");
const BookingWizard_module_scss_1 = __importDefault(require("../BookingWizard.module.scss"));
const BookingWizardContext_1 = require("../BookingWizardContext");
const BookingWizardBottomSheet = (props) => {
    const { children, className } = props, bottomSheetProps = __rest(props, ["children", "className"]);
    const { style, className: bwClassname } = react_1.default.useContext(BookingWizardContext_1.BookingWizardContext);
    const classes = (0, classnames_1.default)('roomstay-booking-container', bwClassname, className);
    return (react_1.default.createElement(react_spring_bottom_sheet_1.BottomSheet, Object.assign({ className: classes, style: style }, bottomSheetProps), children));
};
const BWBottomSheetFooter = ({ onPrev, onNext, hidePrev = false, preLabel, nextLabel, disabledNext = false }) => {
    const { theme } = (0, BookingWizardContext_1.useBookingWizard)();
    const { t } = (0, react_i18next_1.useTranslation)();
    if (theme !== BookingWizard_1.EBookingWizardTheme.Images)
        return null;
    return (react_1.default.createElement("div", { className: BookingWizard_module_scss_1.default.footer },
        !hidePrev ? (react_1.default.createElement(BEButton_1.default, { rounded: true, isText: true, primary: true, size: "small", className: (0, classnames_1.default)(BookingWizard_module_scss_1.default.btn, BookingWizard_module_scss_1.default['btn-cancel']), onClick: onPrev }, preLabel || t(Translation_1.Translation.Navigation.Back))) : (react_1.default.createElement("div", null)),
        react_1.default.createElement(BEButton_1.default, { disabled: disabledNext, rounded: true, primary: true, filled: true, size: "small", className: (0, classnames_1.default)(BookingWizard_module_scss_1.default.btn, BookingWizard_module_scss_1.default['btn-next']), onClick: onNext }, nextLabel || t(Translation_1.Translation.Navigation.Next))));
};
exports.BWBottomSheetFooter = BWBottomSheetFooter;
const BWBottomSheetHeader = ({ title, onClose }) => {
    const { isImagesTheme } = (0, BookingWizardContext_1.useBookingWizard)();
    return (react_1.default.createElement("div", { className: BookingWizard_module_scss_1.default.header },
        react_1.default.createElement("div", { className: (0, classnames_1.default)({
                [BookingWizard_module_scss_1.default.title]: isImagesTheme,
            }) }, title),
        react_1.default.createElement(ui_1.Icon, { icon: ui_1.IconType.Close, onClick: onClose })));
};
exports.BWBottomSheetHeader = BWBottomSheetHeader;
exports.default = BookingWizardBottomSheet;
//# sourceMappingURL=BookingWizardBottomSheet.js.map