adf0d17497
publish / version_or_publish (push) Waiting to run
storybook-build / changes (push) Waiting to run
storybook-build / :storybook-build (push) Blocked by required conditions
Sync Gradio Skills to Hugging Face / sync-skills (push) Waiting to run
functional / changes (push) Waiting to run
functional / build-frontend (push) Blocked by required conditions
functional / functional-test-SSR=false (push) Blocked by required conditions
functional / functional-reload (push) Blocked by required conditions
functional / functional-test-SSR=true (push) Blocked by required conditions
hygiene / hygiene-test (push) Waiting to run
python / changes (push) Waiting to run
python / build (push) Blocked by required conditions
python / test-ubuntu-latest-flaky (push) Blocked by required conditions
python / test-ubuntu-latest-not-flaky (push) Blocked by required conditions
python / test-windows-latest-flaky (push) Blocked by required conditions
python / test-windows-latest-not-flaky (push) Blocked by required conditions
js / changes (push) Waiting to run
js / js-test (push) Blocked by required conditions
docs-build / changes (push) Waiting to run
docs-build / docs-build (push) Blocked by required conditions
docs-build / website-build (push) Blocked by required conditions
56 lines
948 B
Svelte
56 lines
948 B
Svelte
<script lang="ts">
|
|
import Image from "./shared/Image.svelte";
|
|
import type { FileData } from "@gradio/client";
|
|
|
|
let {
|
|
value,
|
|
type,
|
|
selected = false
|
|
}: {
|
|
value: null | FileData;
|
|
type: "gallery" | "table";
|
|
selected?: boolean;
|
|
} = $props();
|
|
</script>
|
|
|
|
<div
|
|
class="container"
|
|
class:table={type === "table"}
|
|
class:gallery={type === "gallery"}
|
|
class:selected
|
|
class:border={value}
|
|
>
|
|
{#if value}
|
|
<Image src={value.url} alt="" />
|
|
{/if}
|
|
</div>
|
|
|
|
<style>
|
|
.container :global(img) {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.container.selected {
|
|
border-color: var(--border-color-accent);
|
|
}
|
|
.border.table {
|
|
border: 2px solid var(--border-color-primary);
|
|
}
|
|
|
|
.container.table {
|
|
margin: 0 auto;
|
|
border-radius: var(--radius-lg);
|
|
overflow: hidden;
|
|
width: var(--size-20);
|
|
height: var(--size-20);
|
|
object-fit: cover;
|
|
}
|
|
|
|
.container.gallery {
|
|
width: var(--size-20);
|
|
max-width: var(--size-20);
|
|
object-fit: cover;
|
|
}
|
|
</style>
|