Line data Source code
1 : import type { PlanRowCopy } from '@comfyorg/account-ui/billing'
2 : import { computed } from 'vue'
3 : import { useI18n } from 'vue-i18n'
4 :
5 : import { isCloud } from '@/platform/distribution/types'
6 :
7 5 : const k = 'workspacePanel.billingTab.plan'
8 :
9 : /** The Billing tab plan row strings in the app locale. */
10 5 : export function usePlanRowCopy() {
11 5 : const { t } = useI18n()
12 5 : return computed<PlanRowCopy>(() => ({
13 : noPlanTitle: t(`${k}.noPlan.title`),
14 : unknownTitle: t(`${k}.unknown.title`),
15 : salesManagedTitle: t(`${k}.salesManaged.title`),
16 : activating: (plan) => t(`${k}.activating`, { plan }),
17 : activeMonthly: (date) => t(`${k}.active.monthly`, { date }),
18 : activeYearly: (date) => t(`${k}.active.yearly`, { date }),
19 : scheduledChange: (plan, date) => t(`${k}.scheduledChange`, { plan, date }),
20 : paused: t(`${k}.paused`),
21 : noPlanLine: t(isCloud ? `${k}.noPlan.line` : `${k}.noPlan.localLine`),
22 : freeRunsLeft: (remaining, total) =>
23 : t(`${k}.noPlan.freeRunsLeft`, { remaining, total }),
24 : freeRunsUsed: (total) => t(`${k}.noPlan.freeRunsUsed`, { total }),
25 : salesManagedLine: t(`${k}.salesManaged.line`),
26 : salesManagedRenews: (date) => t(`${k}.salesManaged.renews`, { date }),
27 : ending: (date) => t(`${k}.ending`, { date }),
28 : ended: (date) => t(`${k}.ended`, { date }),
29 : endedNoDate: t(`${k}.endedNoDate`),
30 : managedByOwner: t(`${k}.managedByOwner`),
31 : actions: {
32 : manage: t(`${k}.actions.manage`),
33 : subscribe: t(`${k}.actions.subscribe`),
34 : choosePlan: t(`${k}.actions.choosePlan`),
35 : contactSales: t(`${k}.actions.contactSales`)
36 : }
37 : }))
38 : }
|