render-active-subscription.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { ActiveSubscription } from '../../../../../frontend/js/features/subscription/components/dashboard/states/active/active'
  2. import { PaidSubscription } from '../../../../../types/subscription/dashboard/subscription'
  3. import { groupPlans, plans } from '../fixtures/plans'
  4. import { renderWithSubscriptionDashContext } from './render-with-subscription-dash-context'
  5. import { MetaTag } from '@/utils/meta'
  6. import { CurrencyCode } from '../../../../../types/subscription/currency'
  7. export function renderActiveSubscription(
  8. subscription: PaidSubscription,
  9. tags: MetaTag[] = [],
  10. currencyCode?: CurrencyCode,
  11. canUseFlexibleLicensing?: boolean
  12. ) {
  13. renderWithSubscriptionDashContext(
  14. <ActiveSubscription subscription={subscription} />,
  15. {
  16. currencyCode,
  17. metaTags: [
  18. ...tags,
  19. { name: 'ol-plans', value: plans },
  20. {
  21. name: 'ol-groupPlans',
  22. value: groupPlans,
  23. },
  24. { name: 'ol-subscription', value: subscription },
  25. {
  26. name: 'ol-recommendedCurrency',
  27. value: currencyCode || 'USD',
  28. },
  29. {
  30. name: 'ol-canUseFlexibleLicensing',
  31. value:
  32. canUseFlexibleLicensing ||
  33. subscription.plan?.canUseFlexibleLicensing ||
  34. false,
  35. },
  36. ],
  37. }
  38. )
  39. }