@churchapps/apphelper
Version:
Library of helper functions for React and NextJS ChurchApps
30 lines • 907 B
TypeScript
import { NotificationCounts } from "../helpers/NotificationService";
import { UserContextInterface } from "@churchapps/helpers";
export interface UseNotificationsResult {
counts: NotificationCounts;
isLoading: boolean;
isReady: boolean;
refresh: () => Promise<void>;
error: string | null;
}
/**
* Custom hook for managing real-time notifications
*
* @param context - User context containing person and church information
* @returns Object containing notification counts and management functions
*
* @example
* ```tsx
* const { counts, isLoading, refresh } = useNotifications(context);
*
* return (
* <UserMenu
* notificationCounts={counts}
* loadCounts={refresh}
* // ... other props
* />
* );
* ```
*/
export declare function useNotifications(context: UserContextInterface | null): UseNotificationsResult;
//# sourceMappingURL=useNotifications.d.ts.map