/** * Component: Setup Wizard Prowlarr Step * Documentation: documentation/setup-wizard.md */ 'use client'; import { useState, useEffect } from 'react'; import { Button } from '@/components/ui/Button'; import { Input } from '@/components/ui/Input'; import { IndexerManagement } from '@/components/admin/indexers/IndexerManagement'; interface ProwlarrStepProps { prowlarrUrl: string; prowlarrApiKey: string; onUpdate: (field: string, value: any) => void; onNext: () => void; onBack: () => void; } interface SelectedIndexer { id: number; name: string; protocol: string; priority: number; seedingTimeMinutes?: number; // Torrents only removeAfterProcessing?: boolean; // Usenet only rssEnabled: boolean; audiobookCategories: number[]; // Categories for audiobook searches ebookCategories: number[]; // Categories for ebook searches } export function ProwlarrStep({ prowlarrUrl, prowlarrApiKey, onUpdate, onNext, onBack, }: ProwlarrStepProps) { const [configuredIndexers, setConfiguredIndexers] = useState([]); const [errorMessage, setErrorMessage] = useState(null); // Sync configured indexers with parent useEffect(() => { onUpdate('prowlarrIndexers', configuredIndexers); }, [configuredIndexers, onUpdate]); const handleNext = () => { setErrorMessage(null); if (!prowlarrUrl || !prowlarrApiKey) { setErrorMessage('Please enter Prowlarr URL and API key'); return; } if (configuredIndexers.length === 0) { setErrorMessage('Please add at least one indexer'); return; } onNext(); }; return (

Configure Prowlarr

Connect to Prowlarr to search for audiobooks across multiple indexers.

onUpdate('prowlarrUrl', e.target.value)} />

The URL where Prowlarr is running (include port)

onUpdate('prowlarrApiKey', e.target.value)} />

Find this in Prowlarr Settings → General → Security → API Key

{errorMessage && (

Error

{errorMessage}

)} {/* Indexer Management Component */}
{/* Navigation Buttons */}
); }