|
5 | 5 | v-else |
6 | 6 | class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5 text-gray-700" |
7 | 7 | > |
8 | | - <div |
9 | | - class="bg-white shadow-md p-3 text-center flex flex-col animate-fade-in-down order-1 lg:order-2" |
10 | | - style="animation-delay: 0.1s" |
11 | | - > |
12 | | - <h3 class="text-2xl font-semibold">Total Surveys</h3> |
| 8 | + <DashboardCard class="order-1 lg:order-2" style="animation-delay: 0.1s"> |
| 9 | + <template v-slot:title>Total Surveys</template> |
13 | 10 | <div |
14 | 11 | class="text-8xl pb-4 font-semibold flex-1 flex items-center justify-center" |
15 | 12 | > |
16 | 13 | {{ data.totalSurveys }} |
17 | 14 | </div> |
18 | | - </div> |
19 | | - <div |
20 | | - class="bg-white shadow-md p-3 text-center flex flex-col order-2 lg:order-4 animate-fade-in-down" |
21 | | - style="animation-delay: 0.2s" |
22 | | - > |
23 | | - <h3 class="text-2xl font-semibold">Total Answers</h3> |
| 15 | + </DashboardCard> |
| 16 | + <DashboardCard class="order-2 lg:order-4" style="animation-delay: 0.2s"> |
| 17 | + <template v-slot:title>Total Answers</template> |
24 | 18 | <div |
25 | 19 | class="text-8xl pb-4 font-semibold flex-1 flex items-center justify-center" |
26 | 20 | > |
27 | 21 | {{ data.totalAnswers }} |
28 | 22 | </div> |
29 | | - </div> |
30 | | - <div |
31 | | - class="row-span-2 animate-fade-in-down order-3 lg:order-1 bg-white shadow-md p-4" |
| 23 | + </DashboardCard> |
| 24 | + <DashboardCard |
| 25 | + class="order-3 lg:order-1 row-span-2" |
| 26 | + style="animation-delay: 0.2s" |
32 | 27 | > |
33 | | - <h3 class="text-2xl font-semibold">Latest Survey</h3> |
| 28 | + <template v-slot:title>Latest Survey</template> |
34 | 29 | <div v-if="data.latestSurvey"> |
35 | 30 | <img |
36 | 31 | :src="data.latestSurvey.image_url" |
|
103 | 98 | <div v-else class="text-gray-600 text-center py-16"> |
104 | 99 | Your don't have surveys yet |
105 | 100 | </div> |
106 | | - </div> |
107 | | - <div |
108 | | - class="bg-white shadow-md p-3 row-span-2 order-4 lg:order-3 animate-fade-in-down" |
109 | | - style="animation-delay: 0.3s" |
110 | | - > |
111 | | - <div class="flex justify-between items-center mb-3 px-2"> |
112 | | - <h3 class="text-2xl font-semibold">Latest Answers</h3> |
| 101 | + </DashboardCard> |
| 102 | + <DashboardCard class="order-4 lg:order-3 row-span-2" style="animation-delay: 0.3s"> |
| 103 | + <template v-slot:title> |
| 104 | + <div class="flex justify-between items-center mb-3 px-2"> |
| 105 | + <h3 class="text-2xl font-semibold">Latest Answers</h3> |
113 | 106 |
|
114 | | - <a |
115 | | - href="javascript:void(0)" |
116 | | - class="text-sm text-blue-500 hover:decoration-blue-500" |
117 | | - > |
118 | | - View all |
119 | | - </a> |
120 | | - </div> |
| 107 | + <a |
| 108 | + href="javascript:void(0)" |
| 109 | + class="text-sm text-blue-500 hover:decoration-blue-500" |
| 110 | + > |
| 111 | + View all |
| 112 | + </a> |
| 113 | + </div> |
| 114 | + </template> |
121 | 115 |
|
122 | | - <div v-if="data.latestAnswers.length"> |
| 116 | + <div v-if="data.latestAnswers.length" class="text-left"> |
123 | 117 | <a |
124 | 118 | href="#" |
125 | 119 | v-for="answer of data.latestAnswers" |
|
136 | 130 | <div v-else class="text-gray-600 text-center py-16"> |
137 | 131 | Your don't have answers yet |
138 | 132 | </div> |
139 | | - </div> |
| 133 | + </DashboardCard> |
140 | 134 | </div> |
141 | 135 | </PageComponent> |
142 | 136 | </template> |
143 | 137 |
|
144 | 138 | <script setup> |
| 139 | +import DashboardCard from "../components/core/DashboardCard.vue"; |
145 | 140 | import PageComponent from "../components/PageComponent.vue"; |
146 | 141 | import { computed } from "vue"; |
147 | 142 | import { useStore } from "vuex"; |
|
0 commit comments