2022-11-14 03:56:48 +01:00
|
|
|
<script setup lang="ts">
|
2023-01-08 07:21:09 +01:00
|
|
|
import type { mastodon } from 'masto'
|
2022-11-14 03:56:48 +01:00
|
|
|
|
2023-02-15 11:34:23 +01:00
|
|
|
const { status, isPreview = false } = defineProps<{
|
2023-01-08 07:21:09 +01:00
|
|
|
status: mastodon.v1.Status | mastodon.v1.StatusEdit
|
2022-12-13 20:26:53 +01:00
|
|
|
fullSize?: boolean
|
2023-02-15 11:34:23 +01:00
|
|
|
isPreview?: boolean
|
2022-11-14 03:56:48 +01:00
|
|
|
}>()
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-11-14 04:33:09 +01:00
|
|
|
<div class="status-media-container" :class="`status-media-container-${status.mediaAttachments.length}`">
|
|
|
|
<template v-for="attachment of status.mediaAttachments" :key="attachment.id">
|
2022-11-30 04:27:19 +01:00
|
|
|
<StatusAttachment
|
|
|
|
:attachment="attachment"
|
|
|
|
:attachments="status.mediaAttachments"
|
2022-12-13 20:26:53 +01:00
|
|
|
:full-size="fullSize"
|
2022-11-30 19:22:15 +01:00
|
|
|
w-full
|
|
|
|
h-full
|
2023-02-15 11:34:23 +01:00
|
|
|
:is-preview="isPreview"
|
2022-11-30 04:27:19 +01:00
|
|
|
/>
|
2022-11-14 04:33:09 +01:00
|
|
|
</template>
|
|
|
|
</div>
|
2022-11-14 03:56:48 +01:00
|
|
|
</template>
|
2022-11-14 04:33:09 +01:00
|
|
|
|
|
|
|
<style lang="postcss">
|
|
|
|
.status-media-container {
|
2023-01-10 10:05:59 +01:00
|
|
|
--at-apply: gap-2;
|
2022-11-21 14:38:10 +01:00
|
|
|
position: relative;
|
2022-11-14 04:33:09 +01:00
|
|
|
width: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
.status-media-container-1 {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
}
|
|
|
|
.status-media-container-2 {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
}
|
|
|
|
.status-media-container-3 {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
}
|
|
|
|
.status-media-container-4 {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
}
|
|
|
|
</style>
|