github-actions[bot]
GitHub deploy: c5ef53a09faec59df3d9039e96eb797a276a1162
1554d3e
raw
history blame contribute delete
606 Bytes
<script lang="ts">
import { WEBUI_BASE_URL } from '$lib/constants';
import ImagePreview from './ImagePreview.svelte';
export let src = '';
export let alt = '';
export let className = ' w-full';
export let imageClassName = 'rounded-lg';
let _src = '';
$: _src = src.startsWith('/') ? `${WEBUI_BASE_URL}${src}` : src;
let showImagePreview = false;
</script>
<button
class={className}
on:click={() => {
showImagePreview = true;
}}
>
<img src={_src} {alt} class={imageClassName} draggable="false" data-cy="image" />
</button>
<ImagePreview bind:show={showImagePreview} src={_src} {alt} />