import noop from 'lodash/noop';
import React from 'react';

export const DEFAULT_DASHBOARDS_CONTEXT = {
  currentDashboardId: null,
  dashboards: [],
  nukeService: noop,
  saveServiceCharacteristics: noop,
  saveServiceLayout: noop,
  addService: noop,
  isLoading: false,
  lastSaveTimestamp: null,
  lastSaveError: null,
  isSaving: false,
  isWebSocketConnected: false,
  setCurrentDashboardId: noop,
  dashboardsHash: null,
  addDashboard: noop,
  loadError: null,
};

export const DashboardsContext = React.createContext(
  DEFAULT_DASHBOARDS_CONTEXT
);
DashboardsContext.displayName = 'DashboardsContext';
