Line data Source code
1 16 : <template>
2 0 : <AppDialogPanel size="compact" class="w-90 max-w-full" @close="onClose">
3 : <template #title>
4 : {{ $t(titleKey) }}
5 : </template>
6 :
7 : <p class="m-0 font-inter text-sm text-muted-foreground">
8 : {{ $t(descriptionKey) }}
9 : </p>
10 :
11 : <template #footer>
12 : <Button
13 : :variant="canManage ? 'inverted' : 'secondary'"
14 : size="lg"
15 : :disabled="canManage && isUpdatingPayment"
16 : @click="canManage ? onUpdatePayment() : onClose()"
17 : >
18 : <i
19 : v-if="canManage && isUpdatingPayment"
20 : class="icon-[lucide--loader-circle] animate-spin motion-reduce:animate-none"
21 : />
22 : {{
23 : $t(
24 : canManage
25 : ? 'subscription.paymentRecovery.ownerCta'
26 : : 'subscription.paymentRecovery.memberCta'
27 : )
28 : }}
29 : </Button>
30 : </template>
31 : </AppDialogPanel>
32 : </template>
33 :
34 : <script setup lang="ts">
35 : import AppDialogPanel from '@/components/dialog/AppDialogPanel.vue'
36 : import { computed } from 'vue'
37 :
38 : import Button from '@comfyorg/design-system/button/Button'
39 :
40 : const {
41 : canManage,
42 : status,
43 : isUpdatingPayment = false,
44 : onClose,
45 : onUpdatePayment
46 : } = defineProps<{
47 : canManage: boolean
48 : status: 'paused' | 'payment_failed'
49 : isUpdatingPayment?: boolean
50 : onClose: () => void
51 : onUpdatePayment: () => void
52 : }>()
53 :
54 0 : const titleKey = computed(() =>
55 : status === 'payment_failed'
56 : ? canManage
57 : ? 'subscription.paymentRecovery.paymentFailedOwnerTitle'
58 : : 'subscription.paymentRecovery.paymentFailedMemberTitle'
59 : : 'subscription.paymentRecovery.title'
60 : )
61 :
62 0 : const descriptionKey = computed(() =>
63 : canManage
64 : ? status === 'payment_failed'
65 : ? 'subscription.paymentRecovery.paymentFailedOwnerDescription'
66 : : 'subscription.paymentRecovery.ownerDescription'
67 : : status === 'payment_failed'
68 : ? 'subscription.paymentRecovery.paymentFailedMemberDescription'
69 : : 'subscription.paymentRecovery.memberDescription'
70 : )
71 : </script>
|