File size: 454 Bytes
fcdfd72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<script lang="ts">
  import type { HTMLImgAttributes } from "svelte/elements";
  type $$Props = HTMLImgAttributes;

  import { resolve_wasm_src } from "@gradio/wasm/svelte";

  export let src: HTMLImgAttributes["src"] = undefined;
</script>

{#await resolve_wasm_src(src) then resolved_src}
  <!-- svelte-ignore a11y-missing-attribute -->
  <img src={resolved_src} {...$$restProps} />
{:catch error}
  <p style="color: red;">{error.message}</p>
{/await}