|
20 | 20 | <div :title="title">
|
21 | 21 | {{ title }}
|
22 | 22 | </div>
|
23 |
| - <span |
24 |
| - v-if="$slots['title-after']" |
25 |
| - > |
26 |
| - <slot |
27 |
| - name="title-after" |
28 |
| - /> |
| 23 | + <span v-if="$slots['title-after']"> |
| 24 | + <slot name="title-after" /> |
29 | 25 | </span>
|
30 | 26 | </div>
|
31 | 27 | <div
|
|
60 | 56 | size="large"
|
61 | 57 | @click="$emit('create-button-clicked')"
|
62 | 58 | >
|
| 59 | + <AddIcon /> |
63 | 60 | {{ actionButtonText }}
|
64 | 61 | </KButton>
|
65 | 62 | <KButton
|
|
77 | 74 | v-for="feature in features"
|
78 | 75 | :key="feature"
|
79 | 76 | >
|
80 |
| - <KCard |
81 |
| - class="entity-empty-state-card" |
82 |
| - :title="feature.title" |
83 |
| - > |
84 |
| - <template #icon /> |
| 77 | + <KCard class="entity-empty-state-card"> |
85 | 78 | <template #title>
|
86 | 79 | <component
|
87 |
| - :is="feature.iconVariant" |
| 80 | + :is="getEntityIcon(feature.iconVariant)" |
88 | 81 | :color="`var(--kui-color-text-neutral-stronger, ${KUI_COLOR_TEXT_NEUTRAL_STRONGER})`"
|
89 |
| - :size="KUI_ICON_SIZE_30" |
| 82 | + :size="KUI_ICON_SIZE_40" |
90 | 83 | />
|
91 |
| - <div>{{ feature.title }}</div> |
92 |
| - </template> |
93 |
| - <template #default> |
94 |
| - {{ feature.description }} |
| 84 | + <div class="card-title"> |
| 85 | + {{ feature.title }} |
| 86 | + </div> |
95 | 87 | </template>
|
| 88 | + {{ feature.description }} |
96 | 89 | </KCard>
|
97 | 90 | </template>
|
98 | 91 | </div>
|
|
102 | 95 | <script lang="ts" setup>
|
103 | 96 | import { type PropType } from 'vue'
|
104 | 97 | import { KButton } from '@kong/kongponents'
|
105 |
| -import { BookIcon } from '@kong/icons' |
| 98 | +import { BookIcon, AddIcon, DeployIcon, PlugIcon, ChartDataIcon, AnalyticsIcon } from '@kong/icons' |
106 | 99 | import composables from '../../composables'
|
107 | 100 | import type { EmptyStateFeature } from 'src/types/entity-empty-state'
|
108 |
| -import { KUI_ICON_SIZE_30, KUI_COLOR_TEXT_NEUTRAL_STRONGER } from '@kong/design-tokens' |
| 101 | +import { KUI_ICON_SIZE_40, KUI_COLOR_TEXT_NEUTRAL_STRONGER } from '@kong/design-tokens' |
| 102 | +
|
| 103 | +const getEntityIcon = (iconType: string): object => { |
| 104 | + console.log(iconType) |
| 105 | + switch (iconType) { |
| 106 | + case 'deploy': |
| 107 | + return DeployIcon |
| 108 | + case 'plug': |
| 109 | + return PlugIcon |
| 110 | + case 'chartData': |
| 111 | + return ChartDataIcon |
| 112 | + case 'analytics': |
| 113 | + return AnalyticsIcon |
| 114 | + default: |
| 115 | + return BookIcon |
| 116 | + } |
| 117 | +} |
109 | 118 |
|
110 | 119 | defineProps({
|
111 | 120 | title: {
|
@@ -182,7 +191,7 @@ const { i18n: { t } } = composables.useI18n()
|
182 | 191 | max-width: 640px; // limit width so the description stays readable if it is too long
|
183 | 192 |
|
184 | 193 | p {
|
185 |
| - margin: var(--kui-space-0, $kui-space-0); |
| 194 | + margin: var(--kui-space-30, $kui-space-30); |
186 | 195 | }
|
187 | 196 | }
|
188 | 197 |
|
|
0 commit comments