sepia-search-motore-di-rice.../client/src/components/ActorMiniature.vue

74 lines
1.5 KiB
Vue

<template>
<a v-bind:href="actor.url" rel="nofollow noreferrer noopener" target="_blank" class="actor" v-bind:title="linkTitle">
<img v-if="actor.avatar" v-bind:src="actor.avatar.url" alt="">
<strong>{{ actor.displayName }}</strong>
<span class="actor-handle">
{{ actor.name }}@{{actor.host}}
</span>
</a>
</template>
<style lang="scss">
@import '../scss/_variables';
.actor {
font-size: inherit;
color: #000;
text-decoration: none;
&:hover {
text-decoration: underline;
}
img {
object-fit: cover;
border-radius: 50%;
width: 20px;
height: 20px;
min-width: 20px;
min-height: 20px;
margin-right: 5px;
}
.actor-handle {
color: $grey;
margin: 0 5px;
}
strong,
.actor-handle {
vertical-align: super;
}
@media screen and (max-width: $small-view) {
.actor-handle {
display: block;
margin: 0 0 10px 0;
}
}
}
</style>
<script lang="ts">
import Vue, { PropType } from 'vue'
import { AccountSummary, VideoChannelSummary } from '../../../PeerTube/shared/models'
export default Vue.extend({
props: {
actor: Object as PropType<AccountSummary | VideoChannelSummary>,
type: String
},
computed: {
linkTitle () {
if (this.type === 'channel') return this.$gettext('Go on this channel page')
return this.$gettext('Go on this account page')
}
}
})
</script>