"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuickResponse = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const react_core_1 = require("@patternfly/react-core");
const react_icons_1 = require("@patternfly/react-icons");
const react_styles_1 = require("@patternfly/react-styles");
const QuickResponse = ({ quickResponses, quickResponseContainerProps = { numLabels: 5 }, onSelect, isCompact }) => {
    const [selectedQuickResponse, setSelectedQuickResponse] = (0, react_1.useState)();
    const handleQuickResponseClick = (id, onClick) => {
        setSelectedQuickResponse(id);
        onClick && onClick();
        onSelect && onSelect(id);
    };
    return ((0, jsx_runtime_1.jsx)(react_core_1.LabelGroup, Object.assign({ className: (0, react_styles_1.css)('pf-chatbot__message-quick-response', quickResponseContainerProps === null || quickResponseContainerProps === void 0 ? void 0 : quickResponseContainerProps.className) }, quickResponseContainerProps, { children: quickResponses.map((_a) => {
            var { id, onClick, content, className } = _a, props = __rest(_a, ["id", "onClick", "content", "className"]);
            return ((0, jsx_runtime_1.jsx)(react_core_1.Label, Object.assign({ variant: id === selectedQuickResponse ? undefined : 'outline', icon: id === selectedQuickResponse ? (0, jsx_runtime_1.jsx)(react_icons_1.CheckIcon, {}) : undefined, color: "blue", onClick: () => handleQuickResponseClick(id, onClick), className: (0, react_styles_1.css)(id === selectedQuickResponse && 'pf-chatbot__message-quick-response--selected', className), isCompact: isCompact }, props, { children: content }), id));
        }) })));
};
exports.QuickResponse = QuickResponse;
exports.default = exports.QuickResponse;
