Line data Source code
1 : <template>
2 2356 : <div
3 : :role="copy.tone === 'warning' ? 'alert' : 'status'"
4 : :class="
5 : cn(
6 : 'flex gap-2 rounded-lg border border-solid p-3',
7 : copy.tone === 'warning'
8 : ? 'border-warning/60 bg-warning/10'
9 : : 'border-border',
10 : noticeClass
11 : )
12 : "
13 : data-testid="add-credits-notice"
14 : :data-notice="kind"
15 : >
16 : <i
17 : :class="
18 : cn(
19 : 'mt-0.5 icon-[lucide--circle-alert]',
20 : copy.tone === 'warning' ? 'text-warning' : 'text-muted-foreground'
21 : )
22 : "
23 : aria-hidden="true"
24 : />
25 : <div class="flex flex-col">
26 : <span class="text-foreground">{{ copy.title }}</span>
27 : <span class="text-muted-foreground">
28 1 : <template v-for="(part, index) in copy.body" :key="index">
29 : <a
30 : v-if="part === SUPPORT_TOKEN"
31 : :href="supportUrl"
32 : target="_blank"
33 : rel="noopener noreferrer"
34 : class="text-inherit underline"
35 : >{{ supportLabel }}</a
36 : >
37 : <template v-else>{{ part }}</template>
38 : </template>
39 : </span>
40 : </div>
41 : </div>
42 : </template>
43 :
44 : <script setup lang="ts">
45 : import { cn } from '@comfyorg/tailwind-utils'
46 :
47 : import type { AddCreditsNoticeCopy } from './addCreditsPresentation'
48 : import { SUPPORT_TOKEN } from './addCreditsPresentation'
49 :
50 : const { copy, kind, supportUrl, supportLabel, noticeClass } = defineProps<{
51 : copy: AddCreditsNoticeCopy
52 : kind?: string
53 : supportUrl: string
54 : supportLabel: string
55 : noticeClass?: string
56 : }>()
57 : </script>
|