feat(notifications): add notification history page and API

This commit introduces the notification history feature, allowing users to view a log of their past notifications.

Key changes include:
- Added a "Notifications" link to the sidebar with a new icon.
- Defined API endpoints for fetching notification history and details.
- Added a "sent" status variant for displaying notification status.

Additionally, this commit includes related UI improvements:
- The user's full name is now dynamically displayed in the header, replacing the hardcoded placeholder.
- Table headers are now styled in uppercase for improved readability and consistency.
This commit is contained in:
AmirReza Jamali
2025-09-25 17:09:42 +03:30
parent b5d3654360
commit 85d95530a8
15 changed files with 400 additions and 10 deletions
@@ -0,0 +1,27 @@
import { API_ENDPOINTS } from "@/lib/api";
import { notificationService } from "@/lib/api/services/notification-service";
import { useQuery } from "@tanstack/react-query";
import { useMemo } from "react";
export const useGetNotificationHistoryQuery = (
params?: Record<string, any>,
) => {
const queryKey = useMemo(
() => [API_ENDPOINTS.NOTIFICATIONS.HISTORY, "READ NOTIFICATIONS HISTORY"],
[],
);
return useQuery({
queryKey,
queryFn: () => notificationService.getNotifications(params),
});
};
export const useGetNotificationDetails = (id: string) => {
const queryKey = useMemo(
() => [API_ENDPOINTS.NOTIFICATIONS.DETAILS(id), "NOTIFICATION DETAILS"],
[id],
);
return useQuery({
queryKey,
queryFn: () => notificationService.getNotificationDetails(id),
});
};