mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
style: 🎨 Format code with Biome
This commit is contained in:
parent
7ff9d2302a
commit
3627ac0ef8
296 changed files with 3257 additions and 2808 deletions
|
|
@ -1,16 +1,22 @@
|
|||
<template>
|
||||
<Dialog>
|
||||
<Card class="w-full h-full overflow-hidden relative p-0 *:first:w-full *:first:h-full *:first:object-contain *:first:bg-muted/20">
|
||||
<Card
|
||||
class="w-full h-full overflow-hidden relative p-0 *:first:w-full *:first:h-full *:first:object-contain *:first:bg-muted/20"
|
||||
>
|
||||
<DialogTrigger v-if="lightbox" :as-child="true">
|
||||
<slot />
|
||||
<slot/>
|
||||
</DialogTrigger>
|
||||
<slot v-else />
|
||||
<slot v-else/>
|
||||
<!-- Alt text viewer -->
|
||||
<Popover v-if="attachment.description">
|
||||
<div class="absolute top-0 right-0 p-2">
|
||||
<PopoverTrigger :as-child="true">
|
||||
<Button variant="outline" size="icon" title="View alt text">
|
||||
<Captions />
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
title="View alt text"
|
||||
>
|
||||
<Captions/>
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
</div>
|
||||
|
|
@ -19,26 +25,42 @@
|
|||
</PopoverContent>
|
||||
</Popover>
|
||||
</Card>
|
||||
<DialogContent :hide-close="true"
|
||||
class="duration-200 bg-transparent border-none overflow-hidden !animate-none gap-6 w-screen h-screen !max-w-none">
|
||||
<DialogContent
|
||||
:hide-close="true"
|
||||
class="duration-200 bg-transparent border-none overflow-hidden !animate-none gap-6 w-screen h-screen !max-w-none"
|
||||
>
|
||||
<div class="grid grid-rows-[auto_1fr_auto]">
|
||||
<div class="flex flex-row gap-2 w-full">
|
||||
<DialogTitle class="sr-only">{{ attachment.type }}</DialogTitle>
|
||||
<Button as="a" :href="attachment?.url" target="_blank" :download="true" variant="outline" size="icon"
|
||||
class="ml-auto">
|
||||
<Download />
|
||||
<DialogTitle class="sr-only">
|
||||
{{ attachment.type }}
|
||||
</DialogTitle>
|
||||
<Button
|
||||
as="a"
|
||||
:href="attachment?.url"
|
||||
target="_blank"
|
||||
:download="true"
|
||||
variant="outline"
|
||||
size="icon"
|
||||
class="ml-auto"
|
||||
>
|
||||
<Download/>
|
||||
</Button>
|
||||
<DialogClose :as-child="true">
|
||||
<Button variant="outline" size="icon">
|
||||
<X />
|
||||
<X/>
|
||||
</Button>
|
||||
</DialogClose>
|
||||
</div>
|
||||
<div class="flex items-center justify-center overflow-hidden *:max-h-[80vh] *:max-w-[80vw] *:w-full *:h-full *:object-contain">
|
||||
<slot />
|
||||
<div
|
||||
class="flex items-center justify-center overflow-hidden *:max-h-[80vh] *:max-w-[80vw] *:w-full *:h-full *:object-contain"
|
||||
>
|
||||
<slot/>
|
||||
</div>
|
||||
<DialogDescription class="flex items-center justify-center">
|
||||
<Card v-if="attachment.description" class="max-w-md max-h-48 overflow-auto text-sm">
|
||||
<Card
|
||||
v-if="attachment.description"
|
||||
class="max-w-md max-h-48 overflow-auto text-sm"
|
||||
>
|
||||
<p>{{ attachment.description }}</p>
|
||||
</Card>
|
||||
</DialogDescription>
|
||||
|
|
@ -1,13 +1,17 @@
|
|||
<template>
|
||||
<Base :attachment="attachment">
|
||||
<audio :src="attachment.url" :alt="attachment.description ?? undefined" controls />
|
||||
</Base>
|
||||
<AttachmentBase :attachment="attachment">
|
||||
<audio
|
||||
:src="attachment.url"
|
||||
:alt="attachment.description ?? undefined"
|
||||
controls
|
||||
/>
|
||||
</AttachmentBase>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Attachment } from "@versia/client/schemas";
|
||||
import type { z } from "zod";
|
||||
import Base from "./base.vue";
|
||||
import AttachmentBase from "./attachment-base.vue";
|
||||
|
||||
const { attachment } = defineProps<{
|
||||
attachment: z.infer<typeof Attachment>;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
<template>
|
||||
<Base :attachment="attachment" lightbox>
|
||||
<div class="flex flex-col items-center justify-center min-h-48 text-sm gap-2">
|
||||
<File class="size-12" />
|
||||
<AttachmentBase :attachment="attachment" lightbox>
|
||||
<div
|
||||
class="flex flex-col items-center justify-center min-h-48 text-sm gap-2"
|
||||
>
|
||||
<File class="size-12"/>
|
||||
<span>File attachment</span>
|
||||
</div>
|
||||
</Base>
|
||||
</AttachmentBase>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Attachment } from "@versia/client/schemas";
|
||||
import { File } from "lucide-vue-next";
|
||||
import type { z } from "zod";
|
||||
import Base from "./base.vue";
|
||||
import AttachmentBase from "./attachment-base.vue";
|
||||
|
||||
const { attachment } = defineProps<{
|
||||
attachment: z.infer<typeof Attachment>;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<Base :attachment="attachment" lightbox>
|
||||
<img :src="attachment.url" :alt="attachment.description ?? undefined" />
|
||||
</Base>
|
||||
<AttachmentBase :attachment="attachment" lightbox>
|
||||
<img :src="attachment.url" :alt="attachment.description ?? undefined">
|
||||
</AttachmentBase>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Attachment } from "@versia/client/schemas";
|
||||
import type { z } from "zod";
|
||||
import Base from "./base.vue";
|
||||
import AttachmentBase from "./attachment-base.vue";
|
||||
|
||||
const { attachment } = defineProps<{
|
||||
attachment: z.infer<typeof Attachment>;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
<template>
|
||||
<Base :attachment="attachment">
|
||||
<video :src="attachment.url" :alt="attachment.description ?? undefined" controls />
|
||||
</Base>
|
||||
<AttachmentBase :attachment="attachment">
|
||||
<video
|
||||
:src="attachment.url"
|
||||
:alt="attachment.description ?? undefined"
|
||||
controls
|
||||
>
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
</AttachmentBase>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Attachment } from "@versia/client/schemas";
|
||||
import type { z } from "zod";
|
||||
import Base from "./base.vue";
|
||||
import AttachmentBase from "./attachment-base.vue";
|
||||
|
||||
const { attachment } = defineProps<{
|
||||
attachment: z.infer<typeof Attachment>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue