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} */
|
/** @type {Props} */
|
||||||
let { post = null } = $props();
|
let { post = null, class: className} = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if post?.preview?.has}
|
{#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}
|
{:else}
|
||||||
{#if ['webm', 'mp4'].includes(post.file.ext)}
|
{#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} />
|
<source src={post.file.url} />
|
||||||
</video>
|
</video>
|
||||||
{:else}
|
{: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}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
Loading…
Reference in a new issue