File size: 454 Bytes
4f1015f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!-- frontend/src/shared/Download.svelte -->
<script lang="ts">
	import { Download } from "@gradio/icons";
	import { DownloadLink } from "@gradio/wasm/svelte";
	import { IconButton } from "@gradio/atoms";

	export let value: string;
	
	let download_value: string;
	$: if (value) download_value = URL.createObjectURL(new Blob([value]));
</script>

<DownloadLink
	download="logs.txt"
	href={download_value}
>
	<IconButton Icon={Download} />
</DownloadLink>