// One capability presentation for dataset readers and live environment transports. import { esc } from "./util.js"; import { icon } from "./icons.js"; const STATES = { available: ["Available here", "check"], external: ["Use native framework", "external"], unavailable: ["Unavailable here", "info"], unknown: ["Check availability", "info"], }; export function supportPanel(s) { if (!s?.capabilities?.length) return ""; const f = s.framework || {}; const docs = /^https:\/\//.test(f.docs || "") ? f.docs : null; return `

What you can do here

${s.capabilities.map((c) => { const [status, glyph] = STATES[c.state] || STATES.unknown; return `
${esc(c.label)}${icon(glyph, 13)}${esc(status)}

${esc(c.detail)}

`; }).join("")}
How ${esc(f.label || "this environment")} works

${esc(f.lifecycle)}

${esc(f.reward)}

${s.transport ? `

Connection: ${esc(s.transport)}

` : ""} ${docs ? `${esc(f.label)} documentation ${icon("external", 12)}` : ""}
`; }