/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the "Elastic License * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side * Public License v 1"; you may not use this file except in compliance with, at * your election, the "Elastic License 2.0", the "GNU Affero General Public * License v3.0 only", or the "Server Side Public License, v 1". */ import React, { useEffect, useState } from 'react'; import { EuiButton, EuiSpacer, EuiText, EuiTitle, EuiTourStep } from '@elastic/eui'; import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public/types'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageHeader, EuiPageSection } from '@elastic/eui'; interface StepThreeProps { guidedOnboarding: GuidedOnboardingPluginStart; } export const StepThree = (props: StepThreeProps) => { const { guidedOnboarding: { guidedOnboardingApi }, } = props; const [isTourStepOpen, setIsTourStepOpen] = useState(false); useEffect(() => { const subscription = guidedOnboardingApi ?.isGuideStepActive$('testGuide', 'step3') .subscribe((isStepActive) => { setIsTourStepOpen(isStepActive); }); return () => subscription?.unsubscribe(); }, [guidedOnboardingApi]); return ( <>

Click this button to complete step 3.

} isStepOpen={isTourStepOpen} minWidth={300} onFinish={() => { setIsTourStepOpen(false); }} step={1} stepsTotal={1} title="Step 3" anchorPosition="rightUp" > { await guidedOnboardingApi?.completeGuideStep('testGuide', 'step3'); }} > Complete step 3
); };