// (C) 2021-2026 GoodData Corporation
import { createSlice, } from "@reduxjs/toolkit";
import { accessibleDashboardsEntityAdapter } from "./accessibleDashboardsEntityAdapter.js";
const accessibleDashboardsSlice = createSlice({
    name: "accessibleDashboards",
    initialState: accessibleDashboardsEntityAdapter.getInitialState({
        isLoaded: false,
    }),
    reducers: {
        setAccessibleDashboards: (state, action) => {
            accessibleDashboardsEntityAdapter.setAll(state, action.payload);
            state.isLoaded = true;
        },
        addAccessibleDashboard: (state, action) => {
            accessibleDashboardsEntityAdapter.upsertOne(state, action.payload);
            state.isLoaded = true;
        },
    },
});
export const accessibleDashboardsSliceReducer = accessibleDashboardsSlice.reducer;
// Spread "fixes" TS2742 error
export const accessibleDashboardsActions = { ...accessibleDashboardsSlice.actions };
