Files

19 lines
456 B
TypeScript
Raw Permalink Normal View History

2026-04-25 16:36:34 +08:00
import type { InboxItem } from '../../model/inbox';
import { useAppSelector } from './useAppSelector';
/**
*
*/
export function useInboxList(): InboxItem[] {
return useAppSelector((state) => state.chat.inbox ?? []);
}
/**
*
*/
export function useInboxItem(inboxItemId: string): InboxItem | null {
const list = useInboxList();
return list.find((item) => item._id === inboxItemId) ?? null;
}