2019-01-21 15:08:22 +01:00
|
|
|
<template>
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-content">
|
2020-02-18 08:57:00 +01:00
|
|
|
<div class="media">
|
|
|
|
<div class="media-left">
|
2020-10-10 17:13:59 +02:00
|
|
|
<figure class="image is-48x48" v-if="group.avatar">
|
|
|
|
<img class="is-rounded" :src="group.avatar.url" alt="" />
|
2020-02-18 08:57:00 +01:00
|
|
|
</figure>
|
2020-10-10 17:13:59 +02:00
|
|
|
<b-icon v-else size="is-large" icon="account-group" />
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
|
|
|
<div class="media-content">
|
|
|
|
<router-link
|
2020-08-05 14:39:17 +02:00
|
|
|
:to="{
|
|
|
|
name: RouteName.GROUP,
|
|
|
|
params: { preferredUsername: usernameWithDomain(group) },
|
|
|
|
}"
|
2020-02-18 08:57:00 +01:00
|
|
|
>
|
2020-08-05 14:39:17 +02:00
|
|
|
<h3>{{ group.name }}</h3>
|
2020-02-18 08:57:00 +01:00
|
|
|
<p class="is-6 has-text-grey">
|
2020-08-05 14:39:17 +02:00
|
|
|
<span v-if="group.domain">{{ `@${group.preferredUsername}@${group.domain}` }}</span>
|
|
|
|
<span v-else>{{ `@${group.preferredUsername}` }}</span>
|
2020-02-18 08:57:00 +01:00
|
|
|
</p>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
<div class="content">
|
2020-08-05 14:39:17 +02:00
|
|
|
<p>{{ group.summary }}</p>
|
2019-01-21 15:08:22 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
2020-08-05 14:39:17 +02:00
|
|
|
import { IGroup, usernameWithDomain } from "@/types/actor";
|
2020-02-18 08:57:00 +01:00
|
|
|
import RouteName from "../../router/name";
|
2019-01-21 15:08:22 +01:00
|
|
|
|
|
|
|
@Component
|
|
|
|
export default class GroupCard extends Vue {
|
2020-08-05 14:39:17 +02:00
|
|
|
@Prop({ required: true }) group!: IGroup;
|
2019-04-03 17:29:03 +02:00
|
|
|
|
|
|
|
RouteName = RouteName;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2020-08-05 14:39:17 +02:00
|
|
|
usernameWithDomain = usernameWithDomain;
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
</script>
|