/** * Component: Download Client Card * Documentation: documentation/phase3/download-clients.md */ 'use client'; import React from 'react'; import { DownloadClientType, getClientDisplayName } from '@/lib/interfaces/download-client.interface'; interface DownloadClientCardProps { client: { id: string; type: DownloadClientType; name: string; url: string; enabled: boolean; customPath?: string; postImportCategory?: string; }; onEdit: () => void; onDelete: () => void; } export function DownloadClientCard({ client, onEdit, onDelete }: DownloadClientCardProps) { const typeName = getClientDisplayName(client.type); const typeColorMap: Record = { qbittorrent: 'bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300', transmission: 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300', sabnzbd: 'bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300', nzbget: 'bg-orange-100 dark:bg-orange-900/30 text-orange-700 dark:text-orange-300', deluge: 'bg-teal-100 dark:bg-teal-900/30 text-teal-700 dark:text-teal-300', }; const typeColor = typeColorMap[client.type] || typeColorMap.qbittorrent; // Truncate URL for display const displayUrl = client.url.length > 40 ? `${client.url.substring(0, 40)}...` : client.url; return (
{/* Client Info */}

{client.name}

{!client.enabled && ( Disabled )}
{typeName}

{displayUrl}

{client.customPath && (

Path: {client.customPath}

)} {client.postImportCategory && (

Post-import: {client.postImportCategory}

)}
{/* Action Buttons */}
{/* Edit Button */} {/* Delete Button */}
); }