// (C) 2026 GoodData Corporation
import { createSelector } from "@reduxjs/toolkit";
import { selectDashboardId } from "../meta/metaSelectors.js";
import { selectListedDashboards } from "./listedDashboardsSelectors.js";
/**
 * Selects AI-generated summary of the currently opened dashboard, if available.
 *
 * @internal
 */
export const selectCurrentDashboardSummary = createSelector(selectDashboardId, selectListedDashboards, (dashboardId, listedDashboards) => {
    if (!dashboardId) {
        return undefined;
    }
    return listedDashboards.find((d) => d.identifier === dashboardId)?.summary;
});
