import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2023-2025 GoodData Corporation
import { useIntl } from "react-intl";
import { messages } from "@gooddata/sdk-ui";
import { List, LoadingMask } from "@gooddata/sdk-ui-kit";
import { AddAttributeAction } from "./AddAttributeAction.js";
import { useAttributeHierarchyDialog } from "./AttributeHierarchyDialogProvider.js";
import { AttributeItem } from "./AttributeItem.js";
const DEFAULT_WIDTH = 845;
const DEFAULT_HEIGHT = 388;
const DEFAULT_ROW_HEIGHT = 43;
export function AttributeHierarchyDialogContent() {
    const { formatMessage } = useIntl();
    const { isLoading, attributes } = useAttributeHierarchyDialog();
    const emptyItem = attributes.find((item) => !item.completed);
    const tableTitle = formatMessage(messages["hierarchyLevels"]);
    return (_jsxs("div", { className: "gd-dialog-content attribute-hierarchy-dialog-content", children: [_jsx("div", { className: "attribute-hierarchy-table-title s-attribute-hierarchy-table-title", children: tableTitle }), _jsx(List, { className: "attribute-hierarchy-table s-attribute-hierarchy-table", width: DEFAULT_WIDTH, maxHeight: DEFAULT_HEIGHT, items: attributes, itemHeight: DEFAULT_ROW_HEIGHT, itemsCount: attributes.length, scrollToItem: emptyItem, renderItem: ({ rowIndex, item }) => _jsx(AttributeItem, { rowIndex: rowIndex, attribute: item }) }), _jsx(AddAttributeAction, {}), isLoading ? (_jsx(LoadingMask, { className: "attribute-hierarchy-content-loading-mask s-attribute-hierarchy-content-loading-mask" })) : null] }));
}
//# sourceMappingURL=AttributeHierarchyDialogContent.js.map