import { ForwardedDashboardState } from '../../locator' ; import { DashboardState } from '../../types' ; import { convertSavedPanelsToPanelMap } from './convert_dashboard_panels' ; export const loadDashboardHistoryLocationState = ( state ? ) : Partial < DashboardState > => { if ( ! state ) { return { } ; } const { panels , ... restOfState } = state ; if ( ! panels ?. length ) { return restOfState ; } return { ... restOfState , ... { panels : convertSavedPanelsToPanelMap ( panels ) } , } ; } ;