custom-notification-bell
Version:
A customizable notification bell component
45 lines (40 loc) • 942 B
text/typescript
export interface NotificationBellProps {
websocketUrl: string;
apiUrl: string;
bellIcon?: string;
emptyText?: string;
userId?:string
theme?: "light" | "dark";
showConnectionStatus?: boolean;
autoReconnect?: boolean;
maxReconnectAttempts?: number;
}
export type Notification = {
_id: string;
type: string;
relatedEntity: {
id: string;
}
message: string;
createdAt: string;
read: boolean;
};
export type NotificationItemProps = {
notification: Notification;
onDismiss: (id: string) => void;
};
export interface NotificationListProps {
isloading: boolean;
notifications: Notification[];
onDismiss: (id: string) => void;
onMarkAllAsRead: () => void;
emptyText?: string;
onSeeAll: () => void;
}
export type PaginationInfo = {
currentPage: number;
totalPages: number;
totalCount: number;
hasNextPage: boolean;
hasPrevPage: boolean;
}