mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
2cda6decbe
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.
45 lines
1.6 KiB
TypeScript
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>
|
|
);
|
|
}
|