+ {tmdbData && (() => { const d = tmdbData as TmdbDetail; return (
+
+ {d.title || d.name}
+ {d.release_date && (
+
+ {String(d.release_date).slice(0, 4)}
+
+ )}
+ {d.first_air_date && (
+
+ {String(d.first_air_date).slice(0, 4)}
+
+ )}
+
+ )})()}
+
+ {noInstance || noTierForKind ? (
+
+
+
+
+ {noInstance
+ ? 'No Sonarr or Radarr instance configured'
+ : `No ${kind === 'movie' ? 'Radarr' : 'Sonarr'} instance configured`}
+
+
+ {noInstance
+ ? 'Connect a Sonarr or Radarr instance to start requesting new titles.'
+ : `Add a ${kind === 'movie' ? 'Radarr' : 'Sonarr'} instance to request ${kind === 'movie' ? 'movies' : 'shows'}.`}
+
+
{
+ onClose()
+ navigate('/settings#sonarr-radarr')
+ }}
+ className="inline-flex items-center gap-1.5 h-8 px-3 rounded-full bg-amber-500/15 ring-1 ring-amber-400/40 text-[11.5px] text-amber-100 font-semibold tracking-tight hover:bg-amber-500/25 transition focus-ring"
+ >
+
+ Open Settings
+
+
+
+ ) : (
+ <>
+ {/* Tier picker */}
+ {tierOptions.filter(t => t.instance).length > 1 && (
+
+
+ {tierOptions.map(t => {
+ if (!t.instance) return null
+ const on = tier === t.tier
+ return (
+ setTier(t.tier)}
+ className={`h-8 px-3 rounded text-[11.5px] font-medium tracking-tight transition focus-ring ${
+ on ? 'bg-accent text-void' : 'text-text-3 hover:text-text-1'
+ }`}
+ >
+ {t.tier === '4k' ? '4K' : 'Regular'}
+ {t.instance.name}
+
+ )
+ })}
+
+
+ )}
+
+
+ setProfileId(v ? Number(v) : null)}
+ placeholder="Pick a profile"
+ options={(profiles.data || []).map>((p: any) => ({
+ value: String(p.id),
+ label: p.name,
+ }))}
+ />
+
+
+
+ setRootFolder(v || null)}
+ placeholder="Pick a folder"
+ options={(rootFolders.data || []).map>((r: any) => ({
+ value: r.path,
+ label: {r.path} ,
+ }))}
+ />
+
+
+ {kind === 'tv' && langProfiles.data && langProfiles.data.length > 0 && (
+
+ setLangProfileId(v ? Number(v) : null)}
+ placeholder="Pick a language profile"
+ options={(langProfiles.data || []).map>((p: any) => ({
+ value: String(p.id),
+ label: p.name,
+ }))}
+ />
+
+ )}
+
+ {kind === 'tv' && tvSeasons.length > 0 && (
+
+
+
+ Seasons
+
+
+
+ {Object.values(seasonsRequested).filter(Boolean).length}
+ {' / '}
+ {tvSeasons.length} selected
+
+ {
+ const next: Record = {}
+ for (const s of tvSeasons) next[s.season_number ?? 0] = true
+ setSeasonsRequested(next)
+ }}
+ className="text-accent hover:text-accent-hover transition focus-ring rounded font-medium tracking-tight"
+ >
+ All
+
+ ·
+ setSeasonsRequested({})}
+ className="text-text-3 hover:text-text-1 transition focus-ring rounded font-medium tracking-tight"
+ >
+ None
+
+
+
+
+ {tvSeasons.map(s => {
+ const num = s.season_number ?? 0
+ const on = !!seasonsRequested[num]
+ const label = num === 0 ? 'Specials' : `Season ${num}`
+ return (
+
+ setSeasonsRequested(p => ({ ...p, [num]: !on }))
+ }
+ className={`h-7 px-2.5 rounded-full text-[11px] font-medium tracking-tight transition border focus-ring ${
+ on
+ ? 'bg-accent/15 text-accent border-accent/40'
+ : 'bg-elevated/40 text-text-2 border-border hover:border-border-strong'
+ }`}
+ >
+ {label}
+ {s.episode_count || 0}
+
+ )
+ })}
+
+
+ )}
+
+
+
+ setMonitored(e.target.checked)}
+ className="accent-amber-500"
+ />
+ Monitor for new episodes / releases
+
+
+ setSearchOnAdd(e.target.checked)}
+ className="accent-amber-500"
+ />
+ Search now
+
+
+
+ {result && (
+
+
+ {result.ok ? : }
+ {result.message}
+
+
+ )}
+ >
+ )}
+
+
+