import {Button} from 'sentry/components/core/button'; import {t} from 'sentry/locale'; import IndicatorStore from 'sentry/stores/indicatorStore'; import type {Organization} from 'sentry/types/organization'; import TrialStarter from 'getsentry/components/trialStarter'; type ButtonProps = React.ComponentProps; type Props = React.PropsWithChildren< { organization: Organization; source: string; analyticsData?: Record; handleClick?: () => void; onTrialFailed?: () => void; onTrialStarted?: () => void; requestData?: Record; } & ButtonProps >; function StartTrialButton({ children, organization, source, onTrialStarted, onTrialFailed, handleClick, requestData, analyticsData: _, ...buttonProps }: Props) { return ( { IndicatorStore.addError(t('Error starting trial. Please try again.')); onTrialFailed?.(); }} onTrialStarted={onTrialStarted} requestData={requestData} > {({startTrial, trialStarting, trialStarted}) => ( )} ); } export default StartTrialButton;