import { jsx as _jsx } from "react/jsx-runtime";
import cx from "classnames";
import { RichText } from "@gooddata/sdk-ui-kit";
import { useSectionDescriptionFilters } from "../../../_staging/sharedHooks/useRichTextFilters.js";
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
import { selectEnableRichTextDescriptions, selectEnableRichTextDynamicReferences, selectSeparators, } from "../../../model/store/config/configSelectors.js";
import { selectExecutionTimestamp } from "../../../model/store/ui/uiSelectors.js";
export function DashboardLayoutSectionHeaderDescription({ description, exportData, LoadingComponent, onLoadingChanged, onError, }) {
    const useRichText = useDashboardSelector(selectEnableRichTextDescriptions);
    const isRichTextReferencesEnabled = useDashboardSelector(selectEnableRichTextDynamicReferences);
    const { loading, filters } = useSectionDescriptionFilters();
    const separators = useDashboardSelector(selectSeparators);
    const executionTimestamp = useDashboardSelector(selectExecutionTimestamp);
    const className = cx("gd-paragraph", "description", "s-fluid-layout-row-description");
    return (_jsx("div", { className: className, ...exportData?.description, children: useRichText ? (_jsx(RichText, { className: "gd-layout-row-description-richtext", value: description, renderMode: "view", rawContent: {
                show: !!exportData?.richText,
                dataAttributes: exportData?.richText?.markdown,
            }, execConfig: {
                timestamp: executionTimestamp,
            }, referencesEnabled: isRichTextReferencesEnabled, filters: filters, isFiltersLoading: loading, separators: separators, LoadingComponent: LoadingComponent, onLoadingChanged: onLoadingChanged, onError: onError })) : (description) }));
}
//# sourceMappingURL=DashboardLayoutSectionHeaderDescription.js.map