PluginProbe
Hostinger Tools / 3.0.38
Hostinger Tools v3.0.38
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
hostinger / vue-frontend / src / components / HostingerTools / SectionCard.vue

SectionCard.vue in Hostinger Tools 3.0.38, at vue-frontend/src/components/HostingerTools/SectionCard.vue

88 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <script lang="ts" setup>
2 import Card from "@/components/Card.vue";
3 import Toggle from "@/components/Toggle.vue";
4 import CopyField from "@/components/CopyField.vue";
5 import { SectionItem } from "@/types";
6 import Button from "@/components/Button/Button.vue";
7 import SkeletonLoader from "@/components/Loaders/SkeletonLoader.vue";
8
9 type Props = {
10 title: string;
11 isLoading?: boolean;
12 sectionItems: SectionItem[];
13 };
14
15 type Emits = {
16 "save-section": [value: boolean, item: SectionItem];
17 };
18
19 const props = defineProps<Props>();
20 const emit = defineEmits<Emits>();
21 </script>
22
23 <template>
24 <div class="home-section">
25 <Card v-if="isLoading">
26 <SkeletonLoader class="h-mb-24" width="50%" :height="24" rounded />
27 <SkeletonLoader
28 v-for="(item, index) in sectionItems"
29 :class="{ 'h-mb-24': index !== sectionItems.length - 1 }"
30 width="100%"
31 :height="item.copyLink ? 48 : 24"
32 rounded
33 />
34 </Card>
35 <Card v-else :header="props.title">
36 <div
37 class="home-section__section-item"
38 v-for="item in sectionItems"
39 :key="item.title"
40 >
41 <div class="d-flex flex-direction-column">
42 <div class="d-flex align-items-center justify-content-between w-100">
43 <div class="d-flex flex-column">
44 <h3 class="h-m-0" item.title>{{ item.title }}</h3>
45 <p class="h-m-0 text-body-2">
46 {{ item.description }}
47 </p>
48 </div>
49 <Button
50 @click="item.sideButton?.onClick"
51 v-if="item.sideButton?.text"
52 variant="text"
53 >{{ item.sideButton?.text }}</Button
54 >
55
56 <Toggle
57 v-else-if="item.toggleValue !== undefined"
58 class="h-pl-16"
59 :model-value="Boolean(item.toggleValue)"
60 :bind="false"
61 @click="emit('save-section', Boolean(!item.toggleValue), item)"
62 />
63 </div>
64 </div>
65 <CopyField class="h-mt-16" v-if="item.copyLink" :link="item.copyLink" />
66 </div>
67 </Card>
68 </div>
69 </template>
70
71 <style lang="scss">
72 .home-section {
73 &__section-item {
74 margin-top: 16px;
75 flex-direction: column;
76 display: flex;
77 padding-bottom: 16px;
78 border-bottom: 1px solid var(--gray-border);
79
80 &:last-child {
81 margin-bottom: 0;
82 border-bottom: none;
83 padding-bottom: 0;
84 }
85 }
86 }
87 </style>
88