AwsMarketplaceContractNotLinkable.tsx 2.6 KB

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