add translate for notifications
This commit is contained in:
@@ -11,12 +11,13 @@ import { useQueryClient } from '@tanstack/react-query';
|
||||
import { formatDate } from '@/app/lib/formatDate';
|
||||
|
||||
export default function NotificationsButton() {
|
||||
const t = useTranslations('Global');
|
||||
const norificationTranslate = useTranslations('Notifications');
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const menuRef = useRef<HTMLDivElement | null>(null);
|
||||
const [loadingIds, setLoadingIds] = useState<Set<number>>(new Set());
|
||||
const [isMarkingAll, setIsMarkingAll] = useState(false);
|
||||
const t = useTranslations('Global');
|
||||
|
||||
const { data: notificationList } = useActiveNotifications();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -134,7 +135,7 @@ export default function NotificationsButton() {
|
||||
</div> */}
|
||||
|
||||
<div className="notification-text">
|
||||
{item.message}
|
||||
{norificationTranslate.has(item.message) ? norificationTranslate(item.message): item.message}
|
||||
</div>
|
||||
|
||||
<button
|
||||
|
||||
@@ -10,6 +10,7 @@ import { formatDate, formatDateTime } from '@/app/lib/formatDate';
|
||||
|
||||
export function NotificationsList() {
|
||||
const t = useTranslations('Global');
|
||||
const norificationTranslate = useTranslations('Notifications');
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const [selectedFiles, setSelectedFiles] = useState<Set<number>>(new Set());
|
||||
@@ -170,6 +171,7 @@ export function NotificationsList() {
|
||||
>
|
||||
{(allNotifications?.notifications.length !== 0) && (
|
||||
allNotifications?.notifications.map(item => {
|
||||
console.log(item);
|
||||
return (
|
||||
<div
|
||||
className={`notification-item ${loadingIds.has(item.id) ? 'loading' : ''} ${item.status}`}
|
||||
@@ -195,11 +197,11 @@ export function NotificationsList() {
|
||||
<div
|
||||
className="notification-header"
|
||||
>
|
||||
<div
|
||||
{/* <div
|
||||
className="notification-title"
|
||||
>
|
||||
{item.type} {item.id}
|
||||
</div>
|
||||
</div> */}
|
||||
{/* <div
|
||||
className="notification-status"
|
||||
>
|
||||
@@ -209,7 +211,7 @@ export function NotificationsList() {
|
||||
<div
|
||||
className="notification-text"
|
||||
>
|
||||
{item.message}
|
||||
{norificationTranslate.has(item.message) ? norificationTranslate(item.message): item.message}
|
||||
</div>
|
||||
<div
|
||||
className="notification-footer"
|
||||
|
||||
Reference in New Issue
Block a user