import React from 'react' ; import { KibanaLogic } from '../../../../../shared/kibana' ; import { EuiLinkTo } from '../../../../../shared/react_router_helpers' ; import { TelemetryLogic } from '../../../../../shared/telemetry' ; import { ENGINE_PATH } from '../../../../routes' ; import { generateEncodedPath } from '../../../../utils/encode_path_params' ; const sendEngineTableLinkClickTelemetry = ( ) => { TelemetryLogic . actions . sendAppSearchTelemetry ( { action : 'clicked' , metric : 'engine_table_link' , } ) ; } ; export const navigateToEngine = ( engineName ) => { sendEngineTableLinkClickTelemetry ( ) ; KibanaLogic . values . navigateToUrl ( generateEncodedPath ( ENGINE_PATH , { engineName } ) ) ; } ; export const renderEngineLink = ( engineName ) => ( < EuiLinkTo to = { generateEncodedPath ( ENGINE_PATH , { engineName } ) } onClick = { sendEngineTableLinkClickTelemetry } data - test - subj = "EngineName" > { engineName } < /EuiLinkTo>);