// capa.jsx — CAPA(시정 및 예방조치): 가상 심사 지적사항을 개선 항목으로 추적 const { Icon, Pill, Button } = window.RAlly; const SEVC = { Critical: { bg: '#f3ded7', fg: '#b94a2c' }, Major: { bg: '#fbf0d8', fg: '#9a6a12' }, Minor: { bg: '#e7e3da', fg: '#5a6068' }, }; const Capa = ({ go }) => { const [res, setRes] = React.useState(null); const [busy, setBusy] = React.useState(false); const [done, setDone] = React.useState({}); // 로컬 조치 완료 표시 const [noTrack, setNoTrack] = React.useState(false); const load = () => { setBusy(true); window.RAlly.resolveTrackId().then((tid) => { if (!tid) { setNoTrack(true); setBusy(false); return; } fetch('/api/track/' + tid + '/audit', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ use_llm: false }), }).then((r) => r.json()).then((d) => { setRes(d); setBusy(false); }).catch(() => setBusy(false)); }); }; React.useEffect(load, []); const items = res ? res.findings : []; const openCount = items.filter((f) => !done[f.id]).length; if (noTrack) { return (