Add class to PostMedia
This commit is contained in:
parent
6abd8874f2
commit
8c5d490061
1 changed files with 4 additions and 4 deletions
|
@ -8,17 +8,17 @@
|
|||
*/
|
||||
|
||||
/** @type {Props} */
|
||||
let { post = null } = $props();
|
||||
let { post = null, class: className} = $props();
|
||||
</script>
|
||||
|
||||
{#if post?.preview?.has}
|
||||
<img class:max-h-dvh={settings.limitImageHeight} src={post.preview.url} alt={`Post ${post.id}`} />
|
||||
<img class:max-h-dvh={settings.limitImageHeight} class={className} src={post.preview.url} alt={`Post ${post.id}`} />
|
||||
{:else}
|
||||
{#if ['webm', 'mp4'].includes(post.file.ext)}
|
||||
<video class:max-h-dvh={settings.limitImageHeight} controls playsinline>
|
||||
<video class:max-h-dvh={settings.limitImageHeight} class={className} controls playsinline>
|
||||
<source src={post.file.url} />
|
||||
</video>
|
||||
{:else}
|
||||
<img class:max-h-dvh={settings.limitImageHeight} src={post.file.url} alt={`Post ${post.id}`} />
|
||||
<img class:max-h-dvh={settings.limitImageHeight} class={className} src={post.file.url} alt={`Post ${post.id}`} />
|
||||
{/if}
|
||||
{/if}
|
||||
|
|
Loading…
Reference in a new issue