calckey/packages/client/src/components/MkAvatars.vue

45 lines
776 B
Vue
Raw Normal View History

2019-05-20 23:44:36 +00:00
<template>
2023-04-08 00:01:42 +00:00
<div class="defgtij">
<div v-for="user in users" :key="user.id" class="avatar-holder">
<MkAvatar :user="user" :show-indicator="true" class="avatar" />
</div>
2020-02-08 07:51:27 +00:00
</div>
2019-05-20 23:44:36 +00:00
</template>
2022-01-06 14:07:32 +00:00
<script lang="ts" setup>
2023-04-08 00:01:42 +00:00
import { onMounted, ref } from "vue";
import * as os from "@/os";
2019-05-20 23:44:36 +00:00
2022-01-06 14:07:32 +00:00
const props = defineProps<{
userIds: string[];
}>();
const users = ref([]);
onMounted(async () => {
2023-04-08 00:01:42 +00:00
users.value = await os.api("users/show", {
userIds: props.userIds,
2022-01-06 14:07:32 +00:00
});
2019-05-20 23:44:36 +00:00
});
</script>
2023-01-16 19:40:06 +00:00
<style lang="scss">
.defgtij {
padding: 12px;
grid-gap: 12px;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(30px, 40px));
place-content: center;
2023-01-16 19:40:06 +00:00
2023-01-18 18:56:49 +00:00
> .avatar-holder {
aspect-ratio: 1;
2023-01-18 18:56:49 +00:00
> .avatar {
width: 100%;
height: 100%;
aspect-ratio: 1;
}
2023-01-16 19:40:06 +00:00
}
}
</style>