Files
ReadMeABook/src/app/admin/settings/tabs/DownloadTab/DownloadTab.tsx
T
kikootwo 2cda6decbe Add multi-download-client support and UI management
Implements support for configuring both qBittorrent and SABnzbd simultaneously, including migration from legacy config, protocol-aware routing, and protocol filtering. Adds new CRUD API routes for download clients, new UI management components, and updates setup and settings flows to use the new multi-client architecture. Updates documentation to describe the new structure and usage.
2026-01-29 09:21:33 -05:00

45 lines
1.6 KiB
TypeScript

/**
* Component: Download Client Settings Tab
* Documentation: documentation/settings-pages.md
*/
'use client';
import React from 'react';
import { DownloadClientManagement } from '@/components/admin/download-clients/DownloadClientManagement';
import type { DownloadClientSettings } from '../../lib/types';
interface DownloadTabProps {
downloadClient: DownloadClientSettings;
onChange: (settings: DownloadClientSettings) => void;
onValidationChange: (isValid: boolean) => void;
}
export function DownloadTab({ downloadClient, onChange, onValidationChange }: DownloadTabProps) {
// Store callback in ref to avoid re-running effect when callback reference changes
const onValidationChangeRef = React.useRef(onValidationChange);
onValidationChangeRef.current = onValidationChange;
// Validation is handled by the DownloadClientManagement component
// At least one enabled client is required
React.useEffect(() => {
// Always valid in settings mode - validation handled by individual save operations
onValidationChangeRef.current(true);
}, []); // Empty deps - only run once on mount
return (
<div className="space-y-6">
<div>
<h2 className="text-xl font-semibold text-gray-900 dark:text-gray-100 mb-4">
Download Clients
</h2>
<p className="text-gray-600 dark:text-gray-400 mb-6">
Configure one or both download clients to enable automatic downloads. qBittorrent handles torrents, while SABnzbd handles Usenet/NZB downloads.
</p>
</div>
<DownloadClientManagement mode="settings" />
</div>
);
}