"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CardList = void 0;
const classnames_1 = __importDefault(require("classnames"));
const react_1 = __importDefault(require("react"));
const react_2 = require("swiper/react");
const CardList_module_scss_1 = __importDefault(require("./CardList.module.scss"));
const MemberCardItem_1 = require("./MemberCardItem");
const CardList = ({ options = [], onChange, value, onNewCardClicked }) => {
    const onCardClicked = (card) => {
        onChange === null || onChange === void 0 ? void 0 : onChange(card);
    };
    return (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement("div", { className: CardList_module_scss_1.default['card-list'] },
            react_1.default.createElement(react_2.Swiper, { className: (0, classnames_1.default)(CardList_module_scss_1.default['card-list-swiper'], 'u-marg-bottom--heavy', 'u-marg-bottom--none@l'), breakpoints: {
                    992: {
                        enabled: false,
                        spaceBetween: 0,
                    },
                }, spaceBetween: 8, enabled: true, slidesPerView: "auto" },
                options.map((card) => {
                    const onClick = () => {
                        onCardClicked(card);
                    };
                    return (react_1.default.createElement(react_2.SwiperSlide, { key: card.cardId, style: {
                            width: 'auto',
                        } },
                        react_1.default.createElement(MemberCardItem_1.MemberCardItem, { selected: (value === null || value === void 0 ? void 0 : value.cardId) === card.cardId, item: card, onClick: onClick })));
                }),
                react_1.default.createElement(react_2.SwiperSlide, { style: {
                        width: 'auto',
                    } },
                    react_1.default.createElement(MemberCardItem_1.MemberCardItem, { selected: !(value === null || value === void 0 ? void 0 : value.cardId), onClick: () => onNewCardClicked === null || onNewCardClicked === void 0 ? void 0 : onNewCardClicked() }))))));
};
exports.CardList = CardList;
//# sourceMappingURL=CardList.js.map