import {Fragment} from 'react'; import {t} from 'sentry/locale'; import AsyncView from 'sentry/views/asyncView'; type Data = { groups: [groupName: string, grouppedWarnings: string[]][]; warnings: string[]; }; type State = AsyncView['state'] & {data: Data | null}; class AdminWarnings extends AsyncView<{}, State> { getEndpoints(): ReturnType { return [['data', '/internal/warnings/']]; } renderBody() { const {data} = this.state; if (data === null) { return null; } const {groups, warnings} = data; return (

{t('System Warnings')}

{!warnings && !groups && t('There are no warnings at this time')} {groups.map(([groupName, groupedWarnings]) => (

{groupName}

    {groupedWarnings.map((warning, i) => (
  • {warning}
  • ))}
))} {warnings.length > 0 && (

Miscellaneous

    {warnings.map((warning, i) => (
  • {warning}
  • ))}
)}
); } } export default AdminWarnings;