/** * Component: Setup Wizard Download Client Step * Documentation: documentation/setup-wizard.md */ 'use client'; import { useState } from 'react'; import { Button } from '@/components/ui/Button'; import { DownloadClientManagement } from '@/components/admin/download-clients/DownloadClientManagement'; import { DownloadClientType } from '@/lib/interfaces/download-client.interface'; interface DownloadClient { id: string; type: DownloadClientType; name: string; enabled: boolean; url: string; username?: string; password: string; disableSSLVerify: boolean; remotePathMappingEnabled: boolean; remotePath?: string; localPath?: string; category?: string; customPath?: string; postImportCategory?: string; } interface DownloadClientStepProps { downloadClients: DownloadClient[]; downloadDir?: string; onUpdate: (field: string, value: any) => void; onNext: () => void; onBack: () => void; } export function DownloadClientStep({ downloadClients, downloadDir, onUpdate, onNext, onBack, }: DownloadClientStepProps) { const [clients, setClients] = useState(downloadClients || []); const [error, setError] = useState(null); // Update parent when clients change const handleClientsChange = (updatedClients: DownloadClient[]) => { setClients(updatedClients); onUpdate('downloadClients', updatedClients); }; const handleNext = () => { // Validate: At least one enabled client required const hasEnabledClient = clients.some(c => c.enabled); if (!hasEnabledClient) { setError('Please add at least one download client before proceeding'); return; } setError(null); onNext(); }; return (

Configure Download Clients

Add at least one download client. You can configure a torrent client (qBittorrent or Transmission) and/or a usenet client (SABnzbd or NZBGet) to search across all indexer types.

{error && (

{error}

)}
); }