CoolFace
Datasetpublic

gradio/frontend

sourceHugging Faceupdated 14h agoView on Hugging Face
1likes442kdownloads
Widgets.svelte21 linesDownload Raw Back to shared
1<script lang="ts">2	import Copy from "./Copy.svelte";3	import Download from "./Download.svelte";4	import { IconButtonWrapper } from "@gradio/atoms";5	import type { CustomButton as CustomButtonType } from "@gradio/utils";6 7	export let value: string;8	export let language: string;9	export let buttons: (string | CustomButtonType)[] | null = null;10	export let on_custom_button_click: ((id: number) => void) | null = null;11</script>12 13<IconButtonWrapper {buttons} {on_custom_button_click}>14	{#if buttons?.some((btn) => typeof btn === "string" && btn === "download")}15		<Download {value} {language} />16	{/if}17	{#if buttons?.some((btn) => typeof btn === "string" && btn === "copy")}18		<Copy {value} />19	{/if}20</IconButtonWrapper>21 
gradio/frontend · CoolFace