1
0
forked from mirror/misskey
misskey/packages/frontend/src/components/MkUsersTooltip.vue

57 lines
1.0 KiB
Vue
Raw Normal View History

<!--
2024-02-12 11:37:45 +09:00
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
2023-05-19 13:58:09 +09:00
<MkTooltip ref="tooltip" :showing="showing" :targetElement="targetElement" :maxWidth="250" @closed="emit('closed')">
2023-01-14 11:46:22 +09:00
<div :class="$style.root">
<div v-for="u in users" :key="u.id" :class="$style.user">
<MkAvatar :class="$style.avatar" :user="u"/>
<MkUserName :user="u" :nowrap="true"/>
2021-11-14 13:13:22 +09:00
</div>
<div v-if="users.length < count">+{{ 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>
2023-01-14 11:46:22 +09:00
<style lang="scss" module>
.root {
font-size: 0.9em;
2021-11-14 13:13:22 +09:00
text-align: left;
2023-01-14 11:46:22 +09:00
}
.user {
line-height: 24px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2021-11-14 13:13:22 +09:00
2023-01-14 11:46:22 +09:00
&:not(:last-child) {
margin-bottom: 3px;
2021-11-14 13:13:22 +09:00
}
}
2023-01-14 11:46:22 +09:00
.avatar {
width: 24px;
height: 24px;
margin-right: 3px;
}
</style>