2022-03-08 21:35:42 +08:00
|
|
|
<script lang="ts">
|
2022-03-17 00:34:30 +08:00
|
|
|
import { createEventDispatcher } from "svelte";
|
2022-03-08 21:35:42 +08:00
|
|
|
import { Label } from "@gradio/label";
|
|
|
|
|
|
|
|
export let value: {
|
|
|
|
label: string;
|
|
|
|
confidences?: Array<{ label: string; confidence: number }>;
|
|
|
|
};
|
2022-03-29 21:10:35 +08:00
|
|
|
|
|
|
|
export let default_value: {
|
|
|
|
label: string;
|
|
|
|
confidences?: Array<{ label: string; confidence: number }>;
|
|
|
|
};
|
2022-03-08 21:35:42 +08:00
|
|
|
export let theme: string;
|
2022-03-23 06:40:36 +08:00
|
|
|
export let style: string | null;
|
2022-03-17 00:34:30 +08:00
|
|
|
|
|
|
|
const dispatch = createEventDispatcher<{ change: undefined }>();
|
|
|
|
|
2022-03-29 21:10:35 +08:00
|
|
|
if (default_value) value = default_value;
|
|
|
|
|
2022-03-17 00:34:30 +08:00
|
|
|
$: value, dispatch("change");
|
2022-03-08 21:35:42 +08:00
|
|
|
</script>
|
|
|
|
|
2022-04-05 06:47:51 +08:00
|
|
|
{#if value !== undefined && value !== null}
|
2022-03-25 12:00:30 +08:00
|
|
|
<Label {theme} {style} {value} />
|
2022-03-25 14:03:47 +08:00
|
|
|
{/if}
|