Modals
1 month ago
skeletons
4 months ago
ActionButton.vue
5 months ago
ActionButtonsSection.vue
5 months ago
Banner.vue
3 months ago
FAQ.vue
5 months ago
FormItem.vue
2 months ago
FormsSection.vue
11 months ago
Hero.vue
1 month ago
Integrations.vue
4 months ago
Pagination.vue
10 months ago
PluginEntriesTable.vue
4 months ago
PluginEntry.vue
4 months ago
PluginExpansion.vue
8 months ago
ReachContactsSummary.vue
2 weeks ago
SyncStatusLabel.vue
6 months ago
Tabs.vue
9 months ago
Toggle.vue
10 months ago
UsageCard.vue
10 months ago
UsageCardsRow.vue
1 year ago
UsageCardsSection.vue
1 year ago
WooCommerce.vue
2 weeks ago
WooCommerceEntriesTable.vue
4 months ago
UsageCardsRow.vue
57 lines
| 1 | <script setup lang="ts"> |
| 2 | import { computed } from 'vue'; |
| 3 | |
| 4 | import UsageCard from '@/components/UsageCard.vue'; |
| 5 | |
| 6 | interface UsageCardData { |
| 7 | title: string; |
| 8 | layout: 'horizontal' | 'vertical'; |
| 9 | metrics: Array<{ |
| 10 | label: string; |
| 11 | value: string | number; |
| 12 | hasIcon?: boolean; |
| 13 | tooltip?: string; |
| 14 | }>; |
| 15 | } |
| 16 | |
| 17 | interface Props { |
| 18 | usageCards: (UsageCardData | undefined)[]; |
| 19 | isLoading?: boolean; |
| 20 | } |
| 21 | |
| 22 | const props = withDefaults(defineProps<Props>(), { |
| 23 | isLoading: false |
| 24 | }); |
| 25 | |
| 26 | const validCards = computed(() => props.usageCards.filter(Boolean) as UsageCardData[]); |
| 27 | </script> |
| 28 | |
| 29 | <template> |
| 30 | <div class="usage-cards-row"> |
| 31 | <UsageCard |
| 32 | v-for="card in validCards" |
| 33 | :key="card.title" |
| 34 | :title="card.title" |
| 35 | :layout="card.layout" |
| 36 | :metrics="card.metrics" |
| 37 | :is-loading="props.isLoading" |
| 38 | /> |
| 39 | </div> |
| 40 | </template> |
| 41 | |
| 42 | <style scoped lang="scss"> |
| 43 | .usage-cards-row { |
| 44 | display: flex; |
| 45 | flex-direction: column; |
| 46 | align-self: stretch; |
| 47 | gap: 12px; |
| 48 | flex: 1; |
| 49 | } |
| 50 | |
| 51 | @media (max-width: 1023px) { |
| 52 | .usage-cards-row { |
| 53 | flex-direction: column; |
| 54 | } |
| 55 | } |
| 56 | </style> |
| 57 |