Modals
1 month ago
skeletons
5 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
5 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
PluginExpansion.vue
96 lines
| 1 | <script setup lang="ts"> |
| 2 | import FormItem from '@/components/FormItem.vue'; |
| 3 | import type { Form, Integration } from '@/types/models'; |
| 4 | import { toKebabCase } from '@/utils/caseConversion'; |
| 5 | import { translate } from '@/utils/translate'; |
| 6 | |
| 7 | interface Props { |
| 8 | integration: Integration; |
| 9 | forms: Form[]; |
| 10 | } |
| 11 | |
| 12 | const { integration, forms } = defineProps<Props>(); |
| 13 | |
| 14 | const emit = defineEmits<{ |
| 15 | toggleFormStatus: [form: Form, status: boolean]; |
| 16 | viewForm: [form: Form]; |
| 17 | editForm: [form: Form]; |
| 18 | }>(); |
| 19 | </script> |
| 20 | |
| 21 | <template> |
| 22 | <div :id="`plugin-expansion-${toKebabCase(integration.id)}`" class="plugin-expansion-content"> |
| 23 | <div v-if="forms.length > 0" class="plugin-expansion-content__forms-list"> |
| 24 | <FormItem |
| 25 | v-for="(form, index) in forms" |
| 26 | :key="form.formId" |
| 27 | :integration="integration" |
| 28 | :form="form" |
| 29 | :class="{ |
| 30 | 'plugin-expansion-content__form-item--with-top-spacing': forms.length > 1 && index !== 0, |
| 31 | 'plugin-expansion-content__form-item--with-bottom-spacing': forms.length > 1 && index !== forms.length - 1 |
| 32 | }" |
| 33 | @toggle-status="(form, status) => emit('toggleFormStatus', form, status)" |
| 34 | @view-form="(form) => emit('viewForm', form)" |
| 35 | @edit-form="(form) => emit('editForm', form)" |
| 36 | /> |
| 37 | </div> |
| 38 | <div v-else class="plugin-expansion-content__no-forms"> |
| 39 | <span class="plugin-expansion-content__no-forms-text"> |
| 40 | {{ translate('hostinger_reach_plugin_expansion_no_forms') }} |
| 41 | </span> |
| 42 | </div> |
| 43 | </div> |
| 44 | </template> |
| 45 | |
| 46 | <style scoped lang="scss"> |
| 47 | .plugin-expansion-content { |
| 48 | border-radius: 12px; |
| 49 | padding: 16px; |
| 50 | display: flex; |
| 51 | flex-direction: column; |
| 52 | gap: 4px; |
| 53 | box-sizing: border-box; |
| 54 | |
| 55 | &__coming-soon-notice { |
| 56 | background: var(--neutral--100); |
| 57 | padding: 8px 16px; |
| 58 | gap: 10px; |
| 59 | border-radius: 12px; |
| 60 | font-size: 14px; |
| 61 | color: #1d1e20; |
| 62 | display: flex; |
| 63 | flex-direction: row; |
| 64 | align-items: center; |
| 65 | justify-content: space-evenly; |
| 66 | margin-bottom: 20px; |
| 67 | } |
| 68 | |
| 69 | &__forms-list { |
| 70 | display: flex; |
| 71 | flex-direction: column; |
| 72 | gap: 4px; |
| 73 | } |
| 74 | |
| 75 | &__form-item--with-top-spacing { |
| 76 | padding-top: 16px; |
| 77 | } |
| 78 | |
| 79 | &__form-item--with-bottom-spacing { |
| 80 | padding-bottom: 16px; |
| 81 | } |
| 82 | |
| 83 | &__no-forms { |
| 84 | display: flex; |
| 85 | justify-content: center; |
| 86 | align-items: center; |
| 87 | } |
| 88 | |
| 89 | &__no-forms-text { |
| 90 | font-size: 14px; |
| 91 | color: var(--neutral--500); |
| 92 | text-align: center; |
| 93 | } |
| 94 | } |
| 95 | </style> |
| 96 |