import { useEffect, useState } from 'react' import { useMissionRequirements, useWhoCanSupport } from './queries' import { Badge, Panel } from '../../components/ui' import { bandColor, num } from '../../lib/format' const selectCls = 'rounded-lg border border-line/70 bg-navy-900 px-3 py-2 text-sm text-ink outline-none focus:border-gold min-w-[20rem]' // WhoCanSupport reads the persisted screenMATCH qualifications for one requirement (the stored // artifact, never a rescore) and shows who can support that mission today, best first. export function WhoCanSupport() { const requirements = useMissionRequirements() const [reqId, setReqId] = useState('') useEffect(() => { if (!reqId && requirements.data?.length) setReqId(requirements.data[0].id) }, [requirements.data, reqId]) const support = useWhoCanSupport(reqId || null) return ( {support.isLoading ? (

Loading…

) : !support.data?.length ? (

No one has been screened against this requirement yet. Run a screen in screenMATCH, the qualification is stored and appears here.

) : ( )}
) }