Line data Source code
1 5 : <template>
2 : <a
3 4 : v-if="href"
4 : :href
5 : target="_blank"
6 : rel="noopener"
7 : :data-variant="variant"
8 : :class="cn(buttonVariants({ variant, size }), 'shrink-0 no-underline')"
9 : @click="emit('click')"
10 : >
11 : {{ label }}
12 : <slot />
13 : </a>
14 : <CheckoutButton
15 : v-else
16 : :variant
17 : :size
18 : :loading
19 : class="shrink-0"
20 : @click="emit('click')"
21 : >
22 : {{ label }}
23 : <slot />
24 : </CheckoutButton>
25 : </template>
26 :
27 : <script setup lang="ts">
28 : import { buttonVariants } from '@comfyorg/design-system/button.variants'
29 : import type { ButtonVariants } from '@comfyorg/design-system/button.variants'
30 : import { cn } from '@comfyorg/tailwind-utils'
31 :
32 : import CheckoutButton from '#/billing/checkout/CheckoutButton.vue'
33 :
34 : const {
35 : href,
36 : label,
37 : variant,
38 : size,
39 : loading = false
40 : } = defineProps<{
41 : href: string | null
42 : label: string
43 : variant: ButtonVariants['variant']
44 : size: 'md' | 'lg'
45 : loading?: boolean
46 : }>()
47 :
48 2 : const emit = defineEmits<{ click: [] }>()
49 : </script>
|