import { configureStore } from '@reduxjs/toolkit';
import styleReducer from './styleSlice';
import mainReducer from './mainSlice';
import authSlice from './authSlice';
import openAiSlice from './openAiSlice';

import usersSlice from "./users/usersSlice";
import rolesSlice from "./roles/rolesSlice";
import permissionsSlice from "./permissions/permissionsSlice";
import organizationsSlice from "./organizations/organizationsSlice";
import assetsSlice from "./assets/assetsSlice";
import data_sourcesSlice from "./data_sources/data_sourcesSlice";
import ingestion_pipelinesSlice from "./ingestion_pipelines/ingestion_pipelinesSlice";
import telemetry_eventsSlice from "./telemetry_events/telemetry_eventsSlice";
import ai_modelsSlice from "./ai_models/ai_modelsSlice";
import detectionsSlice from "./detections/detectionsSlice";
import incidentsSlice from "./incidents/incidentsSlice";
import response_playbooksSlice from "./response_playbooks/response_playbooksSlice";
import response_actionsSlice from "./response_actions/response_actionsSlice";
import soc_agentsSlice from "./soc_agents/soc_agentsSlice";
import threat_actorsSlice from "./threat_actors/threat_actorsSlice";
import threat_indicatorsSlice from "./threat_indicators/threat_indicatorsSlice";
import threat_campaignsSlice from "./threat_campaigns/threat_campaignsSlice";
import attack_map_eventsSlice from "./attack_map_events/attack_map_eventsSlice";
import risk_assessmentsSlice from "./risk_assessments/risk_assessmentsSlice";
import simulation_labsSlice from "./simulation_labs/simulation_labsSlice";
import simulation_runsSlice from "./simulation_runs/simulation_runsSlice";
import infrastructure_clustersSlice from "./infrastructure_clusters/infrastructure_clustersSlice";
import edge_sensorsSlice from "./edge_sensors/edge_sensorsSlice";
import reportsSlice from "./reports/reportsSlice";
import ai_recommendationsSlice from "./ai_recommendations/ai_recommendationsSlice";

export const store = configureStore({
  reducer: {
    style: styleReducer,
    main: mainReducer,
    auth: authSlice,
    openAi: openAiSlice,

users: usersSlice,
roles: rolesSlice,
permissions: permissionsSlice,
organizations: organizationsSlice,
assets: assetsSlice,
data_sources: data_sourcesSlice,
ingestion_pipelines: ingestion_pipelinesSlice,
telemetry_events: telemetry_eventsSlice,
ai_models: ai_modelsSlice,
detections: detectionsSlice,
incidents: incidentsSlice,
response_playbooks: response_playbooksSlice,
response_actions: response_actionsSlice,
soc_agents: soc_agentsSlice,
threat_actors: threat_actorsSlice,
threat_indicators: threat_indicatorsSlice,
threat_campaigns: threat_campaignsSlice,
attack_map_events: attack_map_eventsSlice,
risk_assessments: risk_assessmentsSlice,
simulation_labs: simulation_labsSlice,
simulation_runs: simulation_runsSlice,
infrastructure_clusters: infrastructure_clustersSlice,
edge_sensors: edge_sensorsSlice,
reports: reportsSlice,
ai_recommendations: ai_recommendationsSlice,
  },
})

// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch
