import { createCustomCachedSelector } from '../../../../state/create_selector' ; import { LegendItemLabel } from '../../../../state/selectors/get_legend_items_labels' ; import { getSettingsSpecSelector } from '../../../../state/selectors/get_settings_specs' ; import { computeLegendSelector } from './compute_legend' ; internal export const getLegendItemsLabelsSelector = createCustomCachedSelector ( [ computeLegendSelector , getSettingsSpecSelector ] , ( legendItems , { showLegendExtra } ) : LegendItemLabel [ ] => legendItems . map ( ( { label , defaultExtra } ) => ( { label : `${ label }${ showLegendExtra ? defaultExtra ?. formatted ?? '' : '' }` , depth : 0 , } ) ) ) ;