import { jsx as _jsx } from "react/jsx-runtime";
import { areObjRefsEqual, objRefToString } from "@gooddata/sdk-model";
import { DialogListEmpty } from "../../Dialog/DialogList/DialogListEmpty.js";
import { StylingSettingListItem } from "./StylingSettingListItem.js";
export function StylingSettingList({ items, itemToColorPreview, emptyMessageElement, onItemClick, onItemEdit, onItemDelete, initiallySelectedItemRef, selectedItemRef, onItemMenuToggle, }) {
    if (items.length === 0) {
        return _jsx(DialogListEmpty, { message: emptyMessageElement, className: "gd-styling-picker-list-empty" });
    }
    return (_jsx("div", { className: "gd-styling-picker-list s-styling-picker-list", children: items.map((item) => (_jsx(StylingSettingListItem, { item: item, itemToColorPreview: itemToColorPreview, isSelected: areObjRefsEqual(item.ref, selectedItemRef), isDeletable: !initiallySelectedItemRef || !areObjRefsEqual(item.ref, initiallySelectedItemRef), onClick: onItemClick, onDelete: onItemDelete, onEdit: onItemEdit, onMenuToggle: onItemMenuToggle }, item.ref ? objRefToString(item.ref) : "default"))) }));
}
