feat(ui/alerts): AllAlertsPage + HistoryPage
AllAlertsPage: state filter chips (Open/Firing/Acked/All). HistoryPage: RESOLVED filter, respects retention window.
This commit is contained in:
@@ -1,3 +1,27 @@
|
||||
import { SectionHeader } from '@cameleer/design-system';
|
||||
import { PageLoader } from '../../components/PageLoader';
|
||||
import { useAlerts } from '../../api/queries/alerts';
|
||||
import { AlertRow } from './AlertRow';
|
||||
import css from './alerts-page.module.css';
|
||||
|
||||
export default function HistoryPage() {
|
||||
return <div>HistoryPage — coming soon</div>;
|
||||
const { data, isLoading, error } = useAlerts({ state: 'RESOLVED', limit: 200 });
|
||||
|
||||
if (isLoading) return <PageLoader />;
|
||||
if (error) return <div className={css.page}>Failed to load history: {String(error)}</div>;
|
||||
|
||||
const rows = data ?? [];
|
||||
|
||||
return (
|
||||
<div className={css.page}>
|
||||
<div className={css.toolbar}>
|
||||
<SectionHeader>History</SectionHeader>
|
||||
</div>
|
||||
{rows.length === 0 ? (
|
||||
<div className={css.empty}>No resolved alerts in retention window.</div>
|
||||
) : (
|
||||
rows.map((a) => <AlertRow key={a.id} alert={a} unread={false} />)
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user