/**
 * amis-ui v6.12.0-beta.0
 * Copyright 2018-2025 fex
 */

import { __extends, __rest, __assign } from 'tslib';
import { themeable } from 'amis-core';
import React__default from 'react';

var ListGroup = /** @class */ (function (_super) {
    __extends(ListGroup, _super);
    function ListGroup() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    ListGroup.prototype.render = function () {
        var _a = this.props, cx = _a.classnames, className = _a.className, expand = _a.expand, placeholder = _a.placeholder, items = _a.items, children = _a.children, itemClassName = _a.itemClassName, itemRender = _a.itemRender, getItemProps = _a.getItemProps; _a.classPrefix; var rest = __rest(_a, ["classnames", "className", "expand", "placeholder", "items", "children", "itemClassName", "itemRender", "getItemProps", "classPrefix"]);
        return (React__default.createElement("div", __assign({}, rest, { className: cx('ListGroup', className, expand ? 'ListGroup--expanded' : '') }),
            Array.isArray(items) && items.length ? (items.map(function (item, index) {
                var itemProps = (getItemProps === null || getItemProps === void 0 ? void 0 : getItemProps({ item: item, index: index })) || {};
                return (React__default.createElement("div", __assign({ key: index }, itemProps, { className: cx('ListGroup-item', itemClassName, itemProps.className) }), itemRender(item, index)));
            })) : placeholder ? (React__default.createElement("div", { className: cx('Placeholder ListGroup-placeholder') })) : null,
            children));
    };
    ListGroup.defaultProps = {
        itemRender: function (item) { return React__default.createElement(React__default.Fragment, null, "".concat(item)); }
    };
    return ListGroup;
}(React__default.Component));
var ListGroup$1 = themeable(ListGroup);

export { ListGroup, ListGroup$1 as default };
