Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | import { ALERT_NAMES_ENUM } from "@features/Notifications/NotificationsCenter/types";
import { Dispatch, SetStateAction } from "react";
export type NotificationTabs =
| "notifications"
| "messages"
| "team"
| "provider"
| "merchant";
export interface GiveNotificationTypes {
initialTab: NotificationTabs;
initialThreadId?: number;
}
export interface SingeleThreadType {
isRead?: boolean;
imgURL?: string;
messageText?: string;
time?: string;
title?: string;
mandatory?: boolean;
id?: number | string;
onClick?: () => void;
primaryImageURL?: string;
secondaryImageURL?: string;
primaryFallbackString?: string;
secondaryFallbackString?: string;
unreadMessagesCount?: number;
}
export type NotificationType = {
accID: number;
alertCategory: string;
alertDescription: string;
alertDisplayName: string;
alertID: number;
alertName: ALERT_NAMES_ENUM;
alertType: "mandatory" | "generic";
challenge: any; //to remove
createdAt: number;
conversationMessage: any;
displayMessage: string;
displayTitle: string;
disputeID: string;
id: string;
legalEntityID: number;
merchant: { accID: number; name: string } | null;
owner: any; // TODO
readAt: number | null;
task: any; //TODO
transaction: {
charged: number;
cost: number;
createdAt: number;
fees: number;
id: string;
} | null;
userAccID: number;
};
export interface NotificationThread {
id?: number;
name?: string;
count?: number;
}
export interface AccountOption {
label: string;
value: string;
type: "all" | "merchant" | "provider";
}
export interface GiveNotificationContextType {
isLoading: boolean;
isEmptyData: boolean;
tab: NotificationTabs;
handleSwitchTabs: (newState: NotificationTabs) => void;
isPAHloggedIn: boolean;
threadList?: SingeleThreadType[];
notificationList?: NotificationType[];
currentThread: NotificationThread | undefined;
isBackgroundFetchingMessages: boolean;
messages: MessagesArrayTypes[];
isFetchingNextPageMessages?: boolean;
hasNextPageMessages?: boolean;
isBackgroundFetchingMessages?: boolean;
fetchNextPageMessages?: () => void;
isThreadMessagesLoading: boolean;
setCurrentThread: Dispatch<SetStateAction<NotificationThread | undefined>>;
merchantId: number;
isLoadingNotifications: boolean;
fetchNotificationsNextPage: () => void;
hasNotificationsNextPage?: boolean;
isFetchingNotificationsNextPage: boolean;
// team messages
teamThreadList?: SingeleThreadType[];
isTeamThreadListLoading: boolean;
fetchNextPageTeamThreadList: () => void;
hasNextPageTeamThreadList?: boolean;
isFetchingNextPageTeamThreadList: boolean;
// threads
fetchNextPageThreadList: () => void;
hasNextPageThreadList?: boolean;
isFetchingNextPageThreadList: boolean;
unreadMessagesCount?: number;
unreadNotifications?: number;
hasMandatoryAlerts?: boolean;
// Team account type selection state
teamAccountType: AccountOption;
setTeamAccountType: Dispatch<SetStateAction<AccountOption>>;
}
|