summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkUsersTooltip.vue
blob: 47a567130c2b2b1f4d1d76cb318f60a0ad72d724 (plain)
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
<template>
<MkTooltip ref="tooltip" :showing="showing" :target-element="targetElement" :max-width="250" @closed="emit('closed')">
	<div class="beaffaef">
		<div v-for="u in users" :key="u.id" class="user">
			<MkAvatar class="avatar" :user="u"/>
			<MkUserName class="name" :user="u" :nowrap="true"/>
		</div>
		<div v-if="users.length < count" class="omitted">+{{ count - users.length }}</div>
	</div>
</MkTooltip>
</template>

<script lang="ts" setup>
import { } from 'vue';
import MkTooltip from './MkTooltip.vue';

defineProps<{
	showing: boolean;
	users: any[]; // TODO
	count: number;
	targetElement: HTMLElement;
}>();

const emit = defineEmits<{
	(ev: 'closed'): void;
}>();
</script>

<style lang="scss">
.beaffaef {
	font-size: 0.9em;
	text-align: left;

	> .user {
		line-height: 24px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;

		&:not(:last-child) {
			margin-bottom: 3px;
		}

		> .avatar {
			width: 24px;
			height: 24px;
			margin-right: 3px;
		}
	}
}
</style>