import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2025-2026 GoodData Corporation
import { useIntl } from "react-intl";
import { useDashboardSelector } from "../../model/react/DashboardStoreProvider.js";
import { selectAttributeFilterConfigsOverrides } from "../../model/store/tabs/attributeFilterConfigs/attributeFilterConfigsSelectors.js";
import { AttributeBar } from "../components/bars/AttributeBar.js";
import { DateBar } from "../components/bars/DateBar.js";
import { KdaBar } from "../components/KdaBar.js";
import { AddFilterButton } from "./AddFilterButton.js";
import { useAttributeFiltersChangeHandler } from "./hooks/useAttributeFiltersChangeHandler.js";
import { usePeriodChangeHandler } from "./hooks/usePeriodChangeHandler.js";
export function FiltersBar() {
    const intl = useIntl();
    const attributeConfigs = useDashboardSelector(selectAttributeFilterConfigsOverrides);
    const { attributeFilters, onChangeAttributeFilter, onDeleteAttributeFilter } = useAttributeFiltersChangeHandler();
    const { isAvailable, options, onPeriodChange } = usePeriodChangeHandler();
    return (_jsx(KdaBar, { title: intl.formatMessage({ id: "kdaDialog.dialog.bars.filters.title" }), content: _jsxs(_Fragment, { children: [
                _jsx(DateBar, { options: options, isAvailable: isAvailable, onPeriodChange: onPeriodChange }), attributeFilters.map((attributeFilter, i) => (_jsx(AttributeBar, { attribute: attributeFilter, attributeConfigs: attributeConfigs, onChange: onChangeAttributeFilter, onDelete: onDeleteAttributeFilter }, i))), _jsx(AddFilterButton, {})
            ] }) }));
}
//# sourceMappingURL=FiltersBar.js.map