frontend/components/notes/attachments.vue
2025-04-10 14:48:03 +02:00

16 lines
580 B
Vue

<template>
<!-- [&:has(>:last-child:nth-child(1))] means "when this element has 1 child" -->
<div class="grid gap-4 grid-cols-2 *:max-h-56 [&:has(>:last-child:nth-child(1))]:grid-cols-1 sm:[&:has(>:last-child:nth-child(1))>*]:max-h-72">
<Attachment v-for="attachment in attachments" :key="attachment.id" :attachment="attachment" />
</div>
</template>
<script lang="ts" setup>
import type { Attachment as AttachmentType } from "@versia/client/types";
import Attachment from "./attachment.vue";
defineProps<{
attachments: AttachmentType[];
}>();
</script>