/* eslint react/no-danger: "off" */ import { useBackend } from '../backend'; import { Button, LabeledList, ProgressBar, Section, NoticeBox } from '../components'; import { NtosWindow } from '../layouts'; import { resolveAsset } from '../assets'; import { Fragment } from 'inferno'; export const NtosNewsBrowser = (props, context) => { const { act, data } = useBackend(context); const { article, download, message } = data; let body = ; if (article) { body = ; } else if (download) { body = ; } return ( {!!message && ( {message} }> {!!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 })} />}> {article.size} GQ ))) || ( There appear to be no outstanding news articles on NTNet today. )}
); }; const ArticleDownloading = (props, context) => { const { act, data } = useBackend(context); const { download_progress, download_maxprogress, download_rate } = data.download; return (
{download_progress} / {download_maxprogress} GQ {download_rate} GQ/s
); };