2023-02-16 11:29:49 -05:00
|
|
|
import { ActiveSubscription } from '../../../../../frontend/js/features/subscription/components/dashboard/states/active/active'
|
|
|
|
import { Subscription } from '../../../../../types/subscription/dashboard/subscription'
|
2023-02-21 10:24:28 -05:00
|
|
|
import { groupPlans, plans } from '../fixtures/plans'
|
2023-02-16 11:29:49 -05:00
|
|
|
import { renderWithSubscriptionDashContext } from './render-with-subscription-dash-context'
|
|
|
|
|
|
|
|
export function renderActiveSubscription(
|
|
|
|
subscription: Subscription,
|
2023-02-21 10:24:49 -05:00
|
|
|
tags: { name: string; value: string | object | Array<object> }[] = [],
|
|
|
|
currencyCode?: string
|
2023-02-16 11:29:49 -05:00
|
|
|
) {
|
|
|
|
const renderOptions = {
|
2023-02-21 10:24:49 -05:00
|
|
|
currencyCode,
|
2023-02-16 11:29:49 -05:00
|
|
|
metaTags: [
|
|
|
|
...tags,
|
|
|
|
{ name: 'ol-plans', value: plans },
|
2023-02-21 10:24:28 -05:00
|
|
|
{
|
|
|
|
name: 'ol-groupPlans',
|
|
|
|
value: groupPlans,
|
|
|
|
},
|
2023-02-16 11:29:49 -05:00
|
|
|
{ name: 'ol-subscription', value: subscription },
|
|
|
|
{
|
|
|
|
name: 'ol-recommendedCurrency',
|
2023-02-21 10:24:49 -05:00
|
|
|
value: currencyCode || 'USD',
|
2023-02-16 11:29:49 -05:00
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
renderWithSubscriptionDashContext(
|
|
|
|
<ActiveSubscription subscription={subscription} />,
|
|
|
|
renderOptions
|
|
|
|
)
|
|
|
|
}
|