import { useServiceConnection } from 'officerdev'; import { useTransmissionSection } from './useTransmissionSection'; import { TorrentsView } from './TorrentsView'; import { StatsView } from './StatsView'; import { SettingsView } from './SettingsView'; import { ConnectionView } from './ConnectionView'; // Right panel of the /transmission workspace — renders the section named by the URL. // // With no daemon configured every other section can only render an error, so the connection form takes over // until there is one. The URL is left alone: once connected, the section already in it is what appears. export const TransmissionView = () => { const section = useTransmissionSection(); const { data, isLoading } = useServiceConnection('transmission'); if (!isLoading && !data?.configured) return ; switch (section) { case 'connection': return ; case 'stats': return ; case 'settings': return ; default: return ; } };