index.vue
3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<script setup lang="ts">
import type { ConnectionsTab } from '@db/pages/profile/types'
const router = useRoute('pages-user-profile-tab')
const connectionData = ref<ConnectionsTab[]>([])
const fetchProjectData = async () => {
if (router.params.tab === 'connections') {
const data = await $api('/pages/profile', {
query: {
tab: router.params.tab,
},
}).catch(err => console.log(err))
connectionData.value = data
}
}
watch(router, fetchProjectData, { immediate: true })
const moreBtnList = [
{ title: 'Share connection', value: 'Share connection' },
{ title: 'Block connection', value: 'Block connection' },
{ type: 'divider', class: 'my-2' },
{ title: 'Delete', value: 'Delete', class: 'text-error' },
]
</script>
<template>
<VRow>
<VCol
v-for="data in connectionData"
:key="data.name"
sm="6"
lg="4"
cols="12"
>
<VCard>
<div class="vertical-more">
<MoreBtn
item-props
:menu-list="moreBtnList"
/>
</div>
<VCardText>
<div class="d-flex flex-column align-center justify-center">
<VAvatar
size="100"
:image="data.avatar"
class="mb-6"
/>
<h5 class="text-h5">
{{ data.name }}
</h5>
<div class="text-body-1">
{{ data.designation }}
</div>
<div class="d-flex align-center flex-wrap gap-4 my-6">
<VChip
v-for="chip in data.chips"
:key="chip.title"
:color="chip.color"
size="small"
>
{{ chip.title }}
</VChip>
</div>
</div>
<div class="d-flex justify-space-around">
<div class="text-center">
<h5 class="text-h5">
{{ data.projects }}
</h5>
<div class="text-body-1">
Projects
</div>
</div>
<div class="text-center">
<h5 class="text-h5">
{{ data.tasks }}
</h5>
<div class="text-body-1">
Tasks
</div>
</div>
<div class="text-center">
<h5 class="text-h5">
{{ data.connections }}
</h5>
<div class="text-body-1">
Connections
</div>
</div>
</div>
<div class="d-flex justify-center gap-4 mt-6">
<VBtn
:prepend-icon="data.isConnected ? 'ri-user-follow-line' : 'ri-user-add-line'"
:variant="data.isConnected ? 'elevated' : 'outlined'"
>
{{ data.isConnected ? 'connected' : 'connect' }}
</VBtn>
<IconBtn
color="secondary"
variant="outlined"
rounded
>
<VIcon icon="ri-mail-open-line" />
</IconBtn>
</div>
</VCardText>
</VCard>
</VCol>
</VRow>
</template>
<style lang="scss">
.vertical-more {
position: absolute;
inset-block-start: 1rem;
inset-inline-end: 0.5rem;
}
</style>