Line data Source code
1 5 : <template>
2 5 : <div :class="cn('flex flex-1 flex-col gap-2 px-5 py-4', rootClass)">
3 : <div class="flex items-center justify-between gap-4">
4 : <div class="flex flex-col gap-2">
5 : <span class="flex items-center gap-1 text-sm text-muted-foreground">
6 : {{ copy.topUp }}
7 : <BillingInfoTip :text="copy.topUpTooltip" />
8 : </span>
9 : <span
10 : class="text-sm font-semibold text-foreground"
11 : data-testid="billing-credits-top-up"
12 : >
13 : {{ formatWholeCredits(centsToCredits(topUpCents), locale) }}
14 : </span>
15 : </div>
16 : <slot />
17 : </div>
18 : <span v-if="topUpInUse" class="text-xs text-muted-foreground">
19 : {{ copy.inUse }}
20 : </span>
21 : </div>
22 : </template>
23 :
24 : <script setup lang="ts">
25 : import { cn } from '@comfyorg/tailwind-utils'
26 :
27 : import BillingInfoTip from './BillingInfoTip.vue'
28 : import { centsToCredits, formatWholeCredits } from './creditsCardCopy'
29 : import type { CreditsCardCopy } from './creditsCardCopy'
30 :
31 : const { topUpCents, topUpInUse, copy, locale, rootClass } = defineProps<{
32 : topUpCents: number
33 : topUpInUse: boolean
34 : copy: CreditsCardCopy
35 : locale: string
36 : rootClass?: string
37 : }>()
38 : </script>
|