2020-02-18 08:57:00 +01:00
|
|
|
<template>
|
2022-01-13 15:04:43 +01:00
|
|
|
<div
|
2022-07-12 10:55:28 +02:00
|
|
|
class="bg-white dark:bg-mbz-purple rounded-lg flex space-x-4 items-center"
|
2022-04-06 18:16:14 +02:00
|
|
|
:class="{ 'flex-col p-4 shadow-md sm:p-8 pb-10 w-80': !inline }"
|
2022-01-14 18:10:50 +01:00
|
|
|
>
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="flex pl-2">
|
2022-03-23 12:33:27 +01:00
|
|
|
<figure class="w-12 h-12" v-if="actor.avatar">
|
|
|
|
<img
|
2022-10-31 13:03:03 +01:00
|
|
|
class="rounded-full object-cover h-full"
|
2022-03-23 12:33:27 +01:00
|
|
|
:src="actor.avatar.url"
|
|
|
|
alt=""
|
|
|
|
width="48"
|
|
|
|
height="48"
|
2022-10-05 12:13:19 +02:00
|
|
|
loading="lazy"
|
2022-03-23 12:33:27 +01:00
|
|
|
/>
|
|
|
|
</figure>
|
2022-07-12 10:55:28 +02:00
|
|
|
<AccountCircle
|
2022-03-23 12:33:27 +01:00
|
|
|
v-else
|
2022-07-12 10:55:28 +02:00
|
|
|
:size="inline ? 24 : 48"
|
2022-03-23 12:33:27 +01:00
|
|
|
class="ltr:-mr-0.5 rtl:-ml-0.5"
|
2022-01-14 18:10:50 +01:00
|
|
|
/>
|
2022-03-23 12:33:27 +01:00
|
|
|
</div>
|
2022-04-06 17:35:10 +02:00
|
|
|
<div :class="{ 'text-center': !inline }" class="overflow-hidden w-full">
|
|
|
|
<h5
|
2022-07-12 10:55:28 +02:00
|
|
|
class="text-xl font-medium violet-title tracking-tight text-gray-900 dark:text-gray-200 whitespace-pre-line line-clamp-2"
|
2022-04-06 17:35:10 +02:00
|
|
|
>
|
2022-03-23 12:33:27 +01:00
|
|
|
{{ displayName(actor) }}
|
|
|
|
</h5>
|
2022-08-26 16:08:58 +02:00
|
|
|
<p class="text-gray-500 dark:text-gray-200 truncate" v-if="actor.name">
|
2022-03-23 12:33:27 +01:00
|
|
|
<span dir="ltr">@{{ usernameWithDomain(actor) }}</span>
|
|
|
|
</p>
|
|
|
|
<div
|
|
|
|
v-if="full"
|
2022-04-22 12:00:47 +02:00
|
|
|
class="only-first-child"
|
|
|
|
:class="{
|
|
|
|
'line-clamp-3': limit,
|
|
|
|
'line-clamp-10': !limit,
|
|
|
|
}"
|
2022-03-23 12:33:27 +01:00
|
|
|
v-html="actor.summary"
|
|
|
|
/>
|
|
|
|
</div>
|
2022-01-14 18:10:50 +01:00
|
|
|
</div>
|
|
|
|
<!-- <div
|
|
|
|
class="p-4 bg-white rounded-lg shadow-md sm:p-8 flex items-center space-x-4"
|
2022-01-13 15:04:43 +01:00
|
|
|
dir="auto"
|
|
|
|
>
|
|
|
|
<div class="flex-shrink-0">
|
|
|
|
<figure class="w-12 h-12" v-if="actor.avatar">
|
|
|
|
<img
|
|
|
|
class="rounded-lg"
|
|
|
|
:src="actor.avatar.url"
|
|
|
|
alt=""
|
|
|
|
width="48"
|
|
|
|
height="48"
|
|
|
|
/>
|
2021-11-07 14:59:20 +01:00
|
|
|
</figure>
|
2022-07-12 10:55:28 +02:00
|
|
|
<o-icon
|
2022-01-13 15:04:43 +01:00
|
|
|
v-else
|
2022-07-12 10:55:28 +02:00
|
|
|
size="large"
|
2022-01-13 15:04:43 +01:00
|
|
|
icon="account-circle"
|
|
|
|
class="ltr:-mr-0.5 rtl:-ml-0.5"
|
|
|
|
/>
|
2021-11-07 14:59:20 +01:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2022-01-13 15:04:43 +01:00
|
|
|
<div class="flex-1 min-w-0">
|
2022-01-14 18:10:50 +01:00
|
|
|
<h5 class="text-xl font-medium violet-title tracking-tight text-gray-900">
|
2022-01-13 15:04:43 +01:00
|
|
|
{{ displayName(actor) }}
|
|
|
|
</h5>
|
2022-01-14 18:10:50 +01:00
|
|
|
<p class="text-gray-500 truncate" v-if="actor.name">
|
2021-11-07 21:02:06 +01:00
|
|
|
<span dir="ltr">@{{ usernameWithDomain(actor) }}</span>
|
2021-11-07 14:59:20 +01:00
|
|
|
</p>
|
|
|
|
<div
|
|
|
|
v-if="full"
|
2022-01-13 15:04:43 +01:00
|
|
|
class="line-clamp-3"
|
2021-11-07 14:59:20 +01:00
|
|
|
:class="{ limit: limit }"
|
|
|
|
v-html="actor.summary"
|
|
|
|
/>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2022-01-14 18:10:50 +01:00
|
|
|
</div> -->
|
2020-02-18 08:57:00 +01:00
|
|
|
</template>
|
2022-07-12 10:55:28 +02:00
|
|
|
<script lang="ts" setup>
|
2022-01-13 15:04:43 +01:00
|
|
|
import { displayName, IActor, usernameWithDomain } from "../../types/actor";
|
2022-07-12 10:55:28 +02:00
|
|
|
import AccountCircle from "vue-material-design-icons/AccountCircle.vue";
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
withDefaults(
|
|
|
|
defineProps<{
|
|
|
|
actor: IActor;
|
|
|
|
full?: boolean;
|
|
|
|
inline?: boolean;
|
|
|
|
popover?: boolean;
|
|
|
|
limit?: boolean;
|
|
|
|
}>(),
|
|
|
|
{
|
|
|
|
full: false,
|
|
|
|
inline: false,
|
|
|
|
popover: false,
|
|
|
|
limit: true,
|
|
|
|
}
|
|
|
|
);
|
2022-01-13 15:04:43 +01:00
|
|
|
</script>
|
2022-04-22 12:00:47 +02:00
|
|
|
<style scoped>
|
2022-07-12 10:55:28 +02:00
|
|
|
.only-first-child :deep(:not(:first-child)) {
|
2022-04-22 12:00:47 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
</style>
|