aboutsummaryrefslogtreecommitdiff
path: root/src/components/status_content/status_content.vue
blob: 0283ce2dd0ed137c02767e7f7e1430f04e8a4c84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<template>
  <div class="StatusContent">
    <slot name="header" />
    <StatusBody
      :status="status"
      :single-line="singleLine"
    >
      <div v-if="status.poll && status.poll.options">
        <poll :base-poll="status.poll" />
      </div>

      <div
        v-if="status.attachments.length !== 0"
        class="attachments media-body"
      >
        <attachment
          v-for="attachment in nonGalleryAttachments"
          :key="attachment.id"
          class="non-gallery"
          :size="attachmentSize"
          :nsfw="nsfwClickthrough"
          :attachment="attachment"
          :allow-play="true"
          :set-media="setMedia()"
          @play="$emit('mediaplay', attachment.id)"
          @pause="$emit('mediapause', attachment.id)"
        />
        <gallery
          v-if="galleryAttachments.length > 0"
          :nsfw="nsfwClickthrough"
          :attachments="galleryAttachments"
          :set-media="setMedia()"
        />
      </div>

      <div
        v-if="status.card && !noHeading"
        class="link-preview media-body"
      >
        <link-preview
          :card="status.card"
          :size="attachmentSize"
          :nsfw="nsfwClickthrough"
        />
      </div>
    </StatusBody>
    <slot name="footer" />
  </div>
</template>

<script src="./status_content.js" ></script>
<style lang="scss">
@import '../../_variables.scss';

$status-margin: 0.75em;

.StatusContent {
  flex: 1;
  min-width: 0;
}
</style>