import styled from '@emotion/styled';
import ButtonBar from 'sentry/components/buttonBar';
import {LinkButton} from 'sentry/components/core/button';
import ExternalLink from 'sentry/components/links/externalLink';
import {IconBusiness} from 'sentry/icons';
import {t, tn} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import type {Organization} from 'sentry/types/organization';
import normalizeUrl from 'sentry/utils/url/normalizeUrl';
import withOrganization from 'sentry/utils/withOrganization';
import {openUpsellModal} from 'getsentry/actionCreators/modal';
import withSubscription from 'getsentry/components/withSubscription';
import type {Subscription} from 'getsentry/types';
import {getTrialDaysLeft} from 'getsentry/utils/billing';
import trackGetsentryAnalytics from 'getsentry/utils/trackGetsentryAnalytics';
type Props = {
organization: Organization;
source: string;
subscription: Subscription;
};
function TargetedOnboardingHeader({organization, source, subscription}: Props) {
if (!organization) {
return null;
}
const trackClickNeedHelp = () =>
trackGetsentryAnalytics('growth.onboarding_clicked_need_help', {
organization,
source,
});
const trackClickUpgrade = () => {
trackGetsentryAnalytics('growth.onboarding_clicked_upgrade', {
source,
organization,
});
};
// if trial is active, show info on that
// otherwise show help button
const cta = subscription.isTrial ? (
openUpsellModal({organization, source: 'targeted-onboarding'})}
>
{t('Trial is Active')}
{tn('%s Day Left', '%s Days Left', getTrialDaysLeft(subscription) || 0)}