Skip to content

Commit

Permalink
Fix download link
Browse files Browse the repository at this point in the history
  • Loading branch information
criamico committed Apr 7, 2022
1 parent db8c8ac commit f3ac9db
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,36 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React from 'react';
import React, { useMemo } from 'react';
import { EuiText, EuiLink } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';

import semverMajor from 'semver/functions/major';
import semverMinor from 'semver/functions/minor';
import semverPatch from 'semver/functions/patch';

import { useKibanaVersion } from '../../hooks';

export const InstallationMessage: React.FunctionComponent = () => {
const kibanaVersion = useKibanaVersion();
const kibanaVersionURLString = useMemo(
() =>
`${semverMajor(kibanaVersion)}-${semverMinor(kibanaVersion)}-${semverPatch(kibanaVersion)}`,
[kibanaVersion]
);

return (
<EuiText>
<FormattedMessage
id="xpack.fleet.enrollmentInstructions.installationMessage"
defaultMessage="Select the appropriate platform and run commands to install, enroll, and start Elastic Agent. Reuse commands to set up agents on more than one host. For aarch64, see our {downloadLink}. For additional guidance, see our {installationLink}."
values={{
downloadLink: (
<EuiLink target="_blank" external href="https://ela.st/download-elastic-agent">
<EuiLink
target="_blank"
external
href={`https://www.elastic.co/downloads/past-releases/elastic-agent-${kibanaVersionURLString}`}
>
<FormattedMessage
id="xpack.fleet.enrollmentInstructions.downloadLink"
defaultMessage="downloads page"
Expand Down

0 comments on commit f3ac9db

Please sign in to comment.