basse notification

This commit is contained in:
hamid zarghami
2025-12-10 09:03:56 +03:30
parent abf2dceabf
commit 9248fe3cee
3 changed files with 19 additions and 0 deletions
@@ -0,0 +1,9 @@
import * as api from "../service/NotificationService";
import { useQuery } from "@tanstack/react-query";
export const useGetNotifications = () => {
return useQuery({
queryKey: ["notifications"],
queryFn: api.getNotifications,
});
};
@@ -5,12 +5,16 @@ import { ArrowLeft, Trash } from 'iconsax-react';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import React from 'react' import React from 'react'
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useGetNotifications } from './hooks/useNotificationData';
type Props = object type Props = object
export default function NotificationsIndex({ }: Props) { export default function NotificationsIndex({ }: Props) {
const { t } = useTranslation('notifications') const { t } = useTranslation('notifications')
const router = useRouter(); const router = useRouter();
const { data } = useGetNotifications();
return ( return (
<div className='h-full bg-inherit relative flex flex-col lg:gap-4'> <div className='h-full bg-inherit relative flex flex-col lg:gap-4'>
@@ -0,0 +1,6 @@
import { api } from "@/config/axios";
export const getNotifications = async () => {
const { data } = await api.get("/public/notifications");
return data;
};