import {Fragment} from 'react'; import LoadingIndicator from 'sentry/components/loadingIndicator'; import {t} from 'sentry/locale'; import {useApiQuery} from 'sentry/utils/queryClient'; type Data = { groups: [groupName: string, grouppedWarnings: string[]][]; warnings: string[]; }; function AdminWarnings() { const {data, isLoading, isError} = useApiQuery(['/internal/warnings/'], { staleTime: 0, }); if (isLoading) { return ; } if (!data || isError) { 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 && (

{t('Miscellaneous')}

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