2019-10-05 19:17:18 +00:00
|
|
|
<docs>
|
|
|
|
```vue
|
|
|
|
<report-card :report="{ reported: { name: 'Some bad guy', preferredUsername: 'kevin' }, reporter: { preferredUsername: 'somePerson34' }, reportContent: 'This is not good'}" />
|
|
|
|
```
|
|
|
|
</docs>
|
2019-09-09 07:31:08 +00:00
|
|
|
<template>
|
|
|
|
<div class="card" v-if="report">
|
|
|
|
<div class="card-content">
|
|
|
|
<div class="media">
|
|
|
|
<div class="media-left">
|
|
|
|
<figure class="image is-48x48" v-if="report.reported.avatar">
|
2019-11-15 17:36:47 +00:00
|
|
|
<img alt="" :src="report.reported.avatar.url" />
|
2019-09-09 07:31:08 +00:00
|
|
|
</figure>
|
2019-11-15 17:36:47 +00:00
|
|
|
<b-icon v-else size="is-large" icon="account-circle" />
|
2019-09-09 07:31:08 +00:00
|
|
|
</div>
|
|
|
|
<div class="media-content">
|
|
|
|
<p class="title is-4">{{ report.reported.name }}</p>
|
|
|
|
<p class="subtitle is-6">@{{ report.reported.preferredUsername }}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="content columns">
|
2019-11-15 17:36:47 +00:00
|
|
|
<div class="column is-one-quarter-desktop">Reported by <img v-if="report.reporter.avatar" class="image" :src="report.reporter.avatar.url" /> @{{ report.reporter.preferredUsername }}</div>
|
|
|
|
<div class="column" v-if="report.content">{{ report.content }}</div>
|
2019-09-09 07:31:08 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
|
|
|
import { IReport } from '@/types/report.model';
|
|
|
|
|
|
|
|
@Component
|
|
|
|
export default class ReportCard extends Vue {
|
|
|
|
@Prop({ required: true }) report!: IReport;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
|
|
.content img.image {
|
|
|
|
display: inline;
|
|
|
|
height: 1.5em;
|
|
|
|
vertical-align: text-bottom;
|
|
|
|
}
|
|
|
|
</style>
|