import { i18n } from '@osd/i18n' ; import { VisualizeConstants } from '../visualize_constants' ; const appPrefixes = { dashboards : { text : i18n . translate ( 'visualize.dashboard.prefix.breadcrumb' , { defaultMessage : 'Dashboard' , } ) , } , } ; const defaultEditText = i18n . translate ( 'visualize.editor.defaultEditBreadcrumbText' , { defaultMessage : 'Edit' , } ) ; export function getLandingBreadcrumbs ( ) { return [ { text : i18n . translate ( 'visualize.listing.breadcrumb' , { defaultMessage : 'Visualize' , } ) , href : `#${ VisualizeConstants . LANDING_PAGE_PATH }` , } , ] ; } export function getCreateBreadcrumbs ( ) { return [ ... getLandingBreadcrumbs ( ) , { text : i18n . translate ( 'visualize.editor.createBreadcrumb' , { defaultMessage : 'Create' , } ) , } , ] ; } export function getBreadcrumbsPrefixedWithApp ( originatingApp ) { const originatingAppBreadcrumb = appPrefixes [ originatingApp ] ; return [ originatingAppBreadcrumb , ... getLandingBreadcrumbs ( ) , { text : defaultEditText } ] ; } export function getEditBreadcrumbs ( text = defaultEditText ) { return [ ... getLandingBreadcrumbs ( ) , { text , } , ] ; }