import { Link } from 'react-router'; import { Button, useToast } from '@cameleer/design-system'; import { AlertStateChip } from '../../components/AlertStateChip'; import { SeverityBadge } from '../../components/SeverityBadge'; import type { AlertDto } from '../../api/queries/alerts'; import { useAckAlert, useMarkAlertRead } from '../../api/queries/alerts'; import css from './alerts-page.module.css'; export function AlertRow({ alert, unread }: { alert: AlertDto; unread: boolean }) { const ack = useAckAlert(); const markRead = useMarkAlertRead(); const { toast } = useToast(); const onAck = async () => { try { await ack.mutateAsync(alert.id); toast({ title: 'Acknowledged', description: alert.title, variant: 'success' }); } catch (e) { toast({ title: 'Ack failed', description: String(e), variant: 'error' }); } }; return (
{alert.message}