Upload folder using huggingface_hub
Browse files
6.2.0/audio/static/StaticAudio.svelte
CHANGED
|
@@ -21,7 +21,7 @@
|
|
| 21 |
export let subtitles: null | FileData | SubtitleData[] = null;
|
| 22 |
export let label: string;
|
| 23 |
export let show_label = true;
|
| 24 |
-
export let buttons: (string | CustomButtonType)[]
|
| 25 |
export let on_custom_button_click: ((id: number) => void) | null = null;
|
| 26 |
export let i18n: I18nFormatter;
|
| 27 |
export let waveform_settings: Record<string, any> = {};
|
|
@@ -43,9 +43,6 @@
|
|
| 43 |
}>();
|
| 44 |
|
| 45 |
$: value && dispatch("change", value);
|
| 46 |
-
|
| 47 |
-
$: buttons_to_render =
|
| 48 |
-
buttons && buttons.length > 0 ? buttons : ["download", "share"];
|
| 49 |
</script>
|
| 50 |
|
| 51 |
<BlockLabel
|
|
@@ -61,10 +58,10 @@
|
|
| 61 |
{:else}
|
| 62 |
<IconButtonWrapper
|
| 63 |
display_top_corner={display_icon_button_wrapper_top_corner}
|
| 64 |
-
buttons
|
| 65 |
{on_custom_button_click}
|
| 66 |
>
|
| 67 |
-
{#if
|
| 68 |
<DownloadLink
|
| 69 |
href={value.is_stream
|
| 70 |
? value.url?.replace("playlist.m3u8", "playlist-file")
|
|
@@ -74,7 +71,7 @@
|
|
| 74 |
<IconButton Icon={Download} label={i18n("common.download")} />
|
| 75 |
</DownloadLink>
|
| 76 |
{/if}
|
| 77 |
-
{#if
|
| 78 |
<ShareButton
|
| 79 |
{i18n}
|
| 80 |
on:error
|
|
|
|
| 21 |
export let subtitles: null | FileData | SubtitleData[] = null;
|
| 22 |
export let label: string;
|
| 23 |
export let show_label = true;
|
| 24 |
+
export let buttons: (string | CustomButtonType)[] = [];
|
| 25 |
export let on_custom_button_click: ((id: number) => void) | null = null;
|
| 26 |
export let i18n: I18nFormatter;
|
| 27 |
export let waveform_settings: Record<string, any> = {};
|
|
|
|
| 43 |
}>();
|
| 44 |
|
| 45 |
$: value && dispatch("change", value);
|
|
|
|
|
|
|
|
|
|
| 46 |
</script>
|
| 47 |
|
| 48 |
<BlockLabel
|
|
|
|
| 58 |
{:else}
|
| 59 |
<IconButtonWrapper
|
| 60 |
display_top_corner={display_icon_button_wrapper_top_corner}
|
| 61 |
+
{buttons}
|
| 62 |
{on_custom_button_click}
|
| 63 |
>
|
| 64 |
+
{#if buttons.some((btn) => typeof btn === "string" && btn === "download")}
|
| 65 |
<DownloadLink
|
| 66 |
href={value.is_stream
|
| 67 |
? value.url?.replace("playlist.m3u8", "playlist-file")
|
|
|
|
| 71 |
<IconButton Icon={Download} label={i18n("common.download")} />
|
| 72 |
</DownloadLink>
|
| 73 |
{/if}
|
| 74 |
+
{#if buttons.some((btn) => typeof btn === "string" && btn === "share")}
|
| 75 |
<ShareButton
|
| 76 |
{i18n}
|
| 77 |
on:error
|