AwsMarketplaceContractNotLinkable.tsx81 lines · main
1import Link from 'next/link'
2import { Button, Card, CardContent } from 'ui'
3
4import { SupportLink } from '../../Support/SupportLink'
5import { CloudMarketplaceContractLinkingIneligibilityReason } from './cloud-marketplace-query'
6
7interface Props {
8 reason: CloudMarketplaceContractLinkingIneligibilityReason
9}
10
11const AwsMarketplaceContractNotLinkable = ({ reason }: Props) => {
12 return (
13 <div className="mt-5 mb-10">
14 <Card className="p-4">
15 <CardContent>{determineCardContent(reason)}</CardContent>
16 </Card>
17 </div>
18 )
19}
20
21function determineCardContent(reason: CloudMarketplaceContractLinkingIneligibilityReason) {
22 switch (reason) {
23 case 'NO_ACTIVE_CONTRACT_FOUND':
24 return (
25 <p>
26 Thanks for purchasing Briven through the AWS Marketplace. It’ll take a moment for all
27 systems to sync before you can link your Briven organization to the AWS Marketplace.
28 Please try again in a few minutes.
29 </p>
30 )
31
32 case 'AWS_ACTIVATE_CREDITS_DEAL':
33 return (
34 <>
35 <p className="mb-4">
36 You’ve accepted a private offer for Briven credits as part of AWS Activate. No further
37 action is required on your end.
38 </p>
39 <p>
40 Your Briven organization’s credit balance will be updated accordingly. Please note
41 that it may take 1 or 2 days for this change to appear on the Dashboard. You can find
42 the credit balance on the{' '}
43 <Link className="underline" href={'/org/_/billing'}>
44 organization's billing page
45 </Link>
46 .
47 </p>
48
49 <Button asChild type="primary" size="medium" className="mt-8">
50 <Link href="/organizations">Go to Dashboard</Link>
51 </Button>
52 </>
53 )
54
55 case 'AGREEMENT_BASED_OFFER':
56 return (
57 <>
58 <p>
59 You’ve accepted a private offer that updated or extended an existing Briven
60 subscription on the AWS Marketplace. No further action is required on your end. Your
61 Briven organization will remain linked to the AWS Marketplace, and your projects will
62 continue to run as usual.
63 </p>
64
65 <Button asChild type="primary" size="medium" className="mt-8">
66 <Link href="/organizations">Go to Dashboard</Link>
67 </Button>
68 </>
69 )
70
71 default:
72 return (
73 <p>
74 Unable to determine the reason why AWS Marketplace onboarding is not possible.{' '}
75 <SupportLink className="underline">Contact support.</SupportLink>
76 </p>
77 )
78 }
79}
80
81export default AwsMarketplaceContractNotLinkable