mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-07 06:00:57 +00:00
@ -13,7 +13,12 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
Tooltip
|
Tooltip
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import { IconArrowRight, IconBellCheck } from '@tabler/icons-react';
|
import {
|
||||||
|
IconArrowRight,
|
||||||
|
IconBellCheck,
|
||||||
|
IconCircleCheck,
|
||||||
|
IconExclamationCircle
|
||||||
|
} from '@tabler/icons-react';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
@ -203,11 +208,14 @@ export function NotificationDrawer({
|
|||||||
<Boundary label='NotificationDrawer'>
|
<Boundary label='NotificationDrawer'>
|
||||||
<Stack gap='xs'>
|
<Stack gap='xs'>
|
||||||
<Divider />
|
<Divider />
|
||||||
{!hasNotifications && (
|
{!notificationQuery.isFetching &&
|
||||||
<Alert color='green'>
|
!notificationQuery.isLoading &&
|
||||||
<Text size='sm'>{t`You have no unread notifications.`}</Text>
|
!notificationQuery.isError &&
|
||||||
</Alert>
|
!hasNotifications && (
|
||||||
)}
|
<Alert color='green' icon={<IconCircleCheck />}>
|
||||||
|
<Text size='sm'>{t`You have no unread notifications.`}</Text>
|
||||||
|
</Alert>
|
||||||
|
)}
|
||||||
{hasNotifications &&
|
{hasNotifications &&
|
||||||
notificationQuery.data?.results?.map((notification: any) => (
|
notificationQuery.data?.results?.map((notification: any) => (
|
||||||
<NotificationEntry
|
<NotificationEntry
|
||||||
@ -221,6 +229,15 @@ export function NotificationDrawer({
|
|||||||
<Loader size='sm' />
|
<Loader size='sm' />
|
||||||
</Center>
|
</Center>
|
||||||
)}
|
)}
|
||||||
|
{notificationQuery.isError && (
|
||||||
|
<Alert
|
||||||
|
color='red'
|
||||||
|
title={t`Error`}
|
||||||
|
icon={<IconExclamationCircle />}
|
||||||
|
>
|
||||||
|
<Text size='sm'>{t`Error loading notifications.`}</Text>
|
||||||
|
</Alert>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Boundary>
|
</Boundary>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
Reference in New Issue
Block a user