import React from 'react' ; import { useActions } from 'kea' ; import { EuiButton , EuiButtonProps , EuiLinkProps } from '@elastic/eui' ; import { FormattedMessage } from '@kbn/i18n-react' ; import { getWorkplaceSearchUrl } from '../../../../shared/enterprise_search_url' ; import { TelemetryLogic } from '../../../../shared/telemetry' ; export const ProductButton = ( ) => { const { sendWorkplaceSearchTelemetry } = useActions ( TelemetryLogic ) ; const buttonProps = { fill : true , iconType : 'popout' , 'data-test-subj' : 'launchButton' , } as EuiButtonProps & EuiLinkProps ; buttonProps . href = getWorkplaceSearchUrl ( ) ; buttonProps . target = '_blank' ; buttonProps . onClick = ( ) => sendWorkplaceSearchTelemetry ( { action : 'clicked' , metric : 'header_launch_button' , } ) ; return ( < EuiButton { ... buttonProps } > < FormattedMessage id = "xpack.enterpriseSearch.workplaceSearch.productCta" defaultMessage = "Open Workplace Search" / > < /EuiButton>); } ;