2020-08-05 14:39:17 +02:00
|
|
|
<template>
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="rounded shadow-lg bg-white dark:bg-mbz-purple dark:text-white">
|
|
|
|
<div
|
|
|
|
class="bg-yellow-2 text-black flex items-center gap-1 p-2 rounded-t-lg"
|
|
|
|
dir="auto"
|
|
|
|
>
|
|
|
|
<figure class="" v-if="member.actor.avatar">
|
|
|
|
<img
|
|
|
|
class="rounded-xl"
|
|
|
|
:src="member.actor.avatar.url"
|
|
|
|
alt=""
|
|
|
|
width="24"
|
|
|
|
height="24"
|
|
|
|
/>
|
2020-12-01 16:14:53 +01:00
|
|
|
</figure>
|
2022-07-12 10:55:28 +02:00
|
|
|
<AccountCircle v-else :size="24" />
|
2020-12-01 16:14:53 +01:00
|
|
|
{{ displayNameAndUsername(member.actor) }}
|
|
|
|
</div>
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="flex items-center gap-2 p-2 pr-4" dir="auto">
|
|
|
|
<div class="flex-1">
|
|
|
|
<div class="p-2 flex gap-2">
|
|
|
|
<div class="">
|
|
|
|
<figure class="" v-if="member.parent.avatar">
|
|
|
|
<img
|
|
|
|
class="rounded-lg"
|
|
|
|
:src="member.parent.avatar.url"
|
|
|
|
alt=""
|
|
|
|
width="48"
|
|
|
|
height="48"
|
|
|
|
/>
|
2020-09-29 09:53:48 +02:00
|
|
|
</figure>
|
2022-07-12 10:55:28 +02:00
|
|
|
<AccountGroup v-else :size="48" />
|
2020-09-29 09:53:48 +02:00
|
|
|
</div>
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="" dir="auto">
|
2020-09-29 09:53:48 +02:00
|
|
|
<router-link
|
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP,
|
2020-11-30 10:24:11 +01:00
|
|
|
params: {
|
|
|
|
preferredUsername: usernameWithDomain(member.parent),
|
|
|
|
},
|
2020-09-29 09:53:48 +02:00
|
|
|
}"
|
|
|
|
>
|
2022-08-12 16:46:44 +02:00
|
|
|
<h2 class="mt-0">{{ member.parent.name }}</h2>
|
|
|
|
<div class="flex flex-col">
|
2022-07-12 10:55:28 +02:00
|
|
|
<span class="text-sm">{{
|
|
|
|
`@${usernameWithDomain(member.parent)}`
|
|
|
|
}}</span>
|
2022-08-12 16:46:44 +02:00
|
|
|
<tag
|
|
|
|
variant="info"
|
|
|
|
v-if="member.role === MemberRole.ADMINISTRATOR"
|
|
|
|
>{{ $t("Administrator") }}</tag
|
|
|
|
>
|
|
|
|
<tag
|
|
|
|
variant="info"
|
|
|
|
v-else-if="member.role === MemberRole.MODERATOR"
|
|
|
|
>{{ $t("Moderator") }}</tag
|
|
|
|
>
|
2022-07-12 10:55:28 +02:00
|
|
|
</div>
|
2020-09-29 09:53:48 +02:00
|
|
|
</router-link>
|
|
|
|
</div>
|
2020-08-05 14:39:17 +02:00
|
|
|
</div>
|
2022-08-12 16:46:44 +02:00
|
|
|
<div
|
|
|
|
class="mt-3 prose dark:prose-invert lg:prose-xl line-clamp-2"
|
|
|
|
v-if="member.parent.summary"
|
|
|
|
v-html="flattenHTMLParagraphs(member.parent.summary)"
|
|
|
|
/>
|
2020-08-05 14:39:17 +02:00
|
|
|
</div>
|
2020-09-29 09:53:48 +02:00
|
|
|
<div>
|
2022-07-12 10:55:28 +02:00
|
|
|
<o-dropdown aria-role="list" position="bottom-left">
|
|
|
|
<template #trigger>
|
|
|
|
<DotsHorizontal class="cursor-pointer" />
|
|
|
|
</template>
|
2020-09-29 09:53:48 +02:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
<o-dropdown-item
|
|
|
|
class="inline-flex gap-1"
|
|
|
|
aria-role="listitem"
|
|
|
|
@click="emit('leave')"
|
|
|
|
>
|
|
|
|
<ExitToApp />
|
2020-09-29 09:53:48 +02:00
|
|
|
{{ $t("Leave") }}
|
2022-07-12 10:55:28 +02:00
|
|
|
</o-dropdown-item>
|
|
|
|
</o-dropdown>
|
2020-08-05 14:39:17 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
<script lang="ts" setup>
|
2020-12-01 16:14:53 +01:00
|
|
|
import { displayNameAndUsername, usernameWithDomain } from "@/types/actor";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { IMember } from "@/types/actor/member.model";
|
|
|
|
import { MemberRole } from "@/types/enums";
|
2020-08-05 14:39:17 +02:00
|
|
|
import RouteName from "../../router/name";
|
2022-07-12 10:55:28 +02:00
|
|
|
import ExitToApp from "vue-material-design-icons/ExitToApp.vue";
|
|
|
|
import DotsHorizontal from "vue-material-design-icons/DotsHorizontal.vue";
|
|
|
|
import AccountGroup from "vue-material-design-icons/AccountGroup.vue";
|
|
|
|
import AccountCircle from "vue-material-design-icons/AccountCircle.vue";
|
|
|
|
import Tag from "@/components/Tag.vue";
|
2022-08-12 16:46:44 +02:00
|
|
|
import { flattenHTMLParagraphs } from "@/utils/html";
|
2020-08-05 14:39:17 +02:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
defineProps<{
|
|
|
|
member: IMember;
|
|
|
|
}>();
|
2020-09-29 09:53:48 +02:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const emit = defineEmits(["leave"]);
|
2020-08-05 14:39:17 +02:00
|
|
|
</script>
|