Rocket.Chat.ReactNative/app/views/RoomView/context.ts

22 lines
565 B
TypeScript
Raw Normal View History

2024-01-25 14:11:07 +00:00
import { createContext, useContext } from 'react';
export type TMessageAction = 'reply' | 'quote' | 'edit' | 'react' | null;
export interface IRoomContext {
rid?: string;
t?: string;
tmid?: string;
sharing?: boolean;
action?: TMessageAction;
selectedMessages: string[];
editCancel?: () => void;
editRequest?: (message: any) => void;
onRemoveQuoteMessage?: (messageId: string) => void;
onSendMessage?: Function;
}
export const RoomContext = createContext<IRoomContext>({} as IRoomContext);
export const useRoomContext = () => useContext(RoomContext);