File size: 723 Bytes
7670cd4
 
 
 
bd02e75
7670cd4
 
 
bd02e75
 
7670cd4
 
bd02e75
 
 
 
 
 
 
7670cd4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script lang="ts">
	import Copy from "./Copy.svelte";
	import Download from "./Download.svelte";
	import { IconButtonWrapper } from "@gradio/atoms";
	import type { CustomButton as CustomButtonType } from "@gradio/utils";

	export let value: string;
	export let language: string;
	export let buttons: (string | CustomButtonType)[] | null = null;
	export let on_custom_button_click: ((id: number) => void) | null = null;
</script>

<IconButtonWrapper {buttons} {on_custom_button_click}>
	{#if buttons?.some((btn) => typeof btn === "string" && btn === "download")}
		<Download {value} {language} />
	{/if}
	{#if buttons?.some((btn) => typeof btn === "string" && btn === "copy")}
		<Copy {value} />
	{/if}
</IconButtonWrapper>