gradio/js/image/shared/Image.svelte
Ali Abdalla 8d909624f6
Fix styling issues with Audio, Image and Video components (#5934)
* audio styling fix

* video styling fix

* image examples styling fix

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2023-10-16 12:51:05 -07:00

25 lines
568 B
Svelte

<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}
<style>
img {
max-width: 100%;
max-height: 100%;
border-radius: var(--radius-lg);
max-width: none;
}
</style>