'use client'; // 消息页:通知列表(回复/删除/举报处理/系统) import { useEffect, useState } from 'react'; import { API } from '@/lib/api'; import { useApp } from './AppProvider'; import { Icon } from './Icons'; const TYPE_MAP = { reply: 'message', post_deleted: 'trash', report_handled: 'shield', system: 'megaphone' }; export default function MessagesPage() { const { currentUser } = useApp(); const [notifications, setNotifications] = useState(null); const [error, setError] = useState(null); useEffect(() => { if (!currentUser) return; API.getNotifications() .then((data) => { setNotifications(data || []); setError(null); API.markAllNotificationsRead().catch(() => {}); }) .catch((e) => { setError(e.message); setNotifications([]); }); }, [currentUser]); if (!currentUser) { return
暂无消息
当有人回复你的帖子或处理你的举报时,会在这里通知你