render-active-subscription.tsx 1021 B

12345678910111213141516171819202122232425262728293031
  1. import { ActiveSubscription } from '../../../../../frontend/js/features/subscription/components/dashboard/states/active/active'
  2. import { RecurlySubscription } from '../../../../../types/subscription/dashboard/subscription'
  3. import { groupPlans, plans } from '../fixtures/plans'
  4. import { renderWithSubscriptionDashContext } from './render-with-subscription-dash-context'
  5. export function renderActiveSubscription(
  6. subscription: RecurlySubscription,
  7. tags: { name: string; value: string | object | Array<object> }[] = [],
  8. currencyCode?: string
  9. ) {
  10. const renderOptions = {
  11. currencyCode,
  12. metaTags: [
  13. ...tags,
  14. { name: 'ol-plans', value: plans },
  15. {
  16. name: 'ol-groupPlans',
  17. value: groupPlans,
  18. },
  19. { name: 'ol-subscription', value: subscription },
  20. {
  21. name: 'ol-recommendedCurrency',
  22. value: currencyCode || 'USD',
  23. },
  24. ],
  25. }
  26. renderWithSubscriptionDashContext(
  27. <ActiveSubscription subscription={subscription} />,
  28. renderOptions
  29. )
  30. }