import React, { useEffect, useState } from 'react'; import { api } from '../lib/api'; import { NotificationDto } from '../types'; export default function Notifications() { const [list, setList] = useState([]); const load = () => api.get('/notifications').then(setList); useEffect(() => { load(); }, []); const markRead = async (id: number) => { await api.post(`/notifications/${id}/read`); load(); }; return (

通知

系统与业务提醒

{list.map((n) => (
{n.title}
{n.type}
{n.content}
{new Date(n.createdAt).toLocaleString()} {!n.readAt && ( )}
))}
); }