'use client'; import { useState } from 'react'; import { adminFetch } from '@/lib/admin-fetch'; import type { AdminTarget } from '@/lib/types'; import { AdminPage, ErrorNote, Field, Panel, Toast, btnPrimary, inputCls, useAdmin } from './shared'; export function Boost() { const { data } = useAdmin<{ targets: AdminTarget[] }>('/targets'); const [q, setQ] = useState(''); const [sel, setSel] = useState>(new Set()); const [factor, setFactor] = useState(0.5); const [seconds, setSeconds] = useState(900); const [msg, setMsg] = useState(null); const [err, setErr] = useState(null); const [busy, setBusy] = useState(false); const list = (data?.targets ?? []).filter((t) => !q || t.hostname.includes(q) || t.name.toLowerCase().includes(q.toLowerCase()) || t.service_id.includes(q)); const toggle = (id: string) => setSel((s) => { const n = new Set(s); if (n.has(id)) n.delete(id); else n.add(id); return n; }); return (
setQ(e.target.value)} placeholder="filter…" className={inputCls} aria-label="Filter" />}>
    {list.map((t) => (
  • ))}
setFactor(Number(e.target.value))} className={`${inputCls} num w-full`} />
setSeconds(Number(e.target.value))} className={`${inputCls} num w-full`} />

{sel.size} targets · ×{factor} for {Math.round(seconds / 60)} min

); }