import {Fragment} from 'react'; import {t} from 'sentry/locale'; import DeprecatedAsyncView from 'sentry/views/deprecatedAsyncView'; type Data = { groups: [groupName: string, grouppedWarnings: string[]][]; warnings: string[]; }; type State = DeprecatedAsyncView['state'] & {data: Data | null}; class AdminWarnings extends DeprecatedAsyncView<{}, 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;