import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2023-2025 GoodData Corporation
import cx from "classnames";
import { useIntl } from "react-intl";
import { messages } from "@gooddata/sdk-ui";
import { Button } from "@gooddata/sdk-ui-kit";
/**
 *
 * @internal
 */
export function AttributeHierarchyDetailPanel({ title, description, attributes, onEdit, }) {
    const { formatMessage } = useIntl();
    const hierarchyLevelsText = formatMessage(messages["hierarchyListLevels"]);
    const editText = formatMessage(messages["hierarchyListEdit"]);
    return (_jsxs("div", { className: "gd-attribute-hierarchy-detail-panel", children: [_jsx("div", { className: "gd-attribute-hierarchy-detail-title", children: title }), description ? (_jsx("div", { className: "gd-attribute-hierarchy-detail-description", children: description })) : null, _jsx("div", { className: "gd-attribute-hierarchy-detail-levels", children: hierarchyLevelsText }), attributes.map((item, index) => {
                const itemClassNames = cx("gd-attribute-hierarchy-detail-item", {
                    "is-date": item.isDate,
                    "is-attribute": !item.isDate,
                });
                return (_jsx("div", { className: itemClassNames, children: item.title }, index));
            }), onEdit ? (_jsx("div", { className: "gd-attribute-hierarchy-detail-panel-actions s-gd-attribute-hierarchy-detail-panel-actions", children: _jsx(Button, { className: "gd-button-secondary gd-icon-pencil gd-button-small gd-attribute-hierarchy-detail-edit-button s-gd-attribute-hierarchy-detail-edit-button", value: editText, onClick: onEdit }) })) : null] }));
}
//# sourceMappingURL=AttributeHierarchyDetailPanel.js.map