{#if value === null || streaming}
{#if active_source === "microphone"}
{#if streaming}
{:else}
{/if}
{:else if active_source === "upload"}
dispatch("error", detail)}
{root}
{max_file_size}
{upload}
{stream_handler}
aria_label={i18n("audio.drop_to_upload")}
>
{/if}
{:else}
(mode = "edit")}
download={buttons === null
? value.url
: buttons.some((btn) => typeof btn === "string" && btn === "download")
? value.url
: null}
>
{#if value !== null && buttons}
{#each buttons as btn}
{#if typeof btn === "string"}
{#if btn === "share"}
{
if (!value) return "";
let url = await uploadToHuggingFace(value.url, "url");
return ``;
}}
{value}
/>
{/if}
{:else}
{
if (on_custom_button_click) {
on_custom_button_click(id);
}
}}
/>
{/if}
{/each}
{/if}
{/if}