File size: 1,078 Bytes
f264e07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41a6d75
 
f264e07
 
 
 
 
 
 
 
 
 
 
 
 
 
41a6d75
f264e07
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!-- frontend/index.svelte -->

<script lang="ts">
	// This component acts as a bridge between the Gradio Python backend and the Svelte UI.
	import TopBarPanel from "./shared/TopBarPanel.svelte";
	import { StatusTracker } from "@gradio/statustracker";
	import type { LoadingStatus } from "@gradio/statustracker";
	import type { Gradio } from "@gradio/utils";
	import Column from "@gradio/column";

	export let open = true;
	export let loading_status: LoadingStatus;
	export let gradio: Gradio<{
		expand: never;
		collapse: never;
	}>;
	export let height: number | string;
	export let width: number | string;
	export let visible = true;
	export let bring_to_front = false;
	export let rounded_borders: boolean = false;

</script>

<StatusTracker
	autoscroll={gradio.autoscroll}
	i18n={gradio.i18n}
	{...loading_status}
/>

{#if visible}
	<TopBarPanel
		bind:open
		{height}
		{width}
		{bring_to_front}
		{rounded_borders}
		on:expand={() => gradio.dispatch("expand")}
		on:collapse={() => gradio.dispatch("collapse")}
	>
		<Column>
			<slot />
		</Column>
	</TopBarPanel>
{/if}