/* eslint react/no-danger: "off" */ import { useBackend } from '../backend'; import { Button, LabeledList, Section } from '../components'; import { Window } from '../layouts'; import { resolveAsset } from '../assets'; export const StarcasterCh = (props, context) => { const { act, data } = useBackend(context); const { article } = data; let body = ; if (article) { body = ; } return ( {body} ); }; const SelectedArticle = (props, context) => { const { act, data } = useBackend(context); const { article } = data; if (!article) { return
Error: Article not found.
; } const { title, cover, content } = article; return (
act('PRG_reset')}> Close }> {!!cover && } {/* News articles are written in premade .html files and cannot be edited by players, so it should be * safe enough to use dangerouslySetInnerHTML here. */}
); }; const ViewArticles = (props, context) => { const { act, data } = useBackend(context); const { showing_archived, all_articles } = data; return (
act('PRG_toggle_archived')} checked={showing_archived}> Show Archived }> {(all_articles.length && all_articles.map((article) => ( act('PRG_openarticle', { uid: article.uid })} />} /> ))) || Unable to connect to Starfire database.}
); };