Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat: add BatchDownload component for displaying batch download feedback and action

Tonho2f97470fb4df
diff --git a/src/components/omnibox/BatchDownload.svelte b/src/components/omnibox/BatchDownload.svelte
new file mode 100644
index 00000000..472d73da
--- /dev/null
+++ b/src/components/omnibox/BatchDownload.svelte
@@ -0,0 +1,62 @@
+<script lang="ts">
+ import { t } from "$lib/i18n";
+
+ let { count, onDownload } = $props();
+</script>
+
+<div class="feedback feedback-enter" data-supported="true">
+ <span class="feedback-text">
+ {$t('omnibox.batch_detected', { count })}
+ </span>
+</div>
+
+<button class="button action-btn" onclick={onDownload}>
+ {$t('omnibox.batch_download_all')}
+</button>
+
+<style>
+ .feedback {
+ display: flex;
+ align-items: center;
+ gap: calc(var(--padding) / 2);
+ }
+
+ .feedback[data-supported="true"] {
+ color: var(--green);
+ }
+
+ .feedback-text {
+ font-size: 12.5px;
+ font-weight: 500;
+ }
+
+ .action-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 6px;
+ padding: var(--padding) calc(var(--padding) * 2);
+ font-size: 14.5px;
+ font-weight: 500;
+ background: var(--button);
+ border: none;
+ border-radius: var(--border-radius);
+ color: var(--button-text);
+ cursor: pointer;
+ box-shadow: var(--button-box-shadow);
+ }
+
+ @media (hover: hover) {
+ .action-btn:hover {
+ background: var(--button-hover);
+ }
+ }
+
+ .action-btn:active {
+ background: var(--button-press);
+ }
+
+ .action-btn:disabled {
+ cursor: default;
+ }
+</style>