softchatjs-react-native
Version:
React native UI SDK for softchatjs-core. Create a free account at: https://www.softchatjs.com
30 lines (27 loc) • 998 B
text/typescript
import React from 'react';
import { TextInput, View } from 'react-native';
import { Message, Conversation } from 'softchatjs-core';
import { ChatBubbleRenderProps } from '../../../types.mjs';
type OnSelectedMessage = {
message: Message;
chatItemRef: React.MutableRefObject<View | undefined>;
};
type ChatItemProps = {
inputRef: React.RefObject<TextInput>;
position: "left" | "right";
onSelectedMessage: ({ message, chatItemRef }: OnSelectedMessage) => void;
message: Message;
conversation: Conversation | null;
onLongPress: (data: OnSelectedMessage & {
isMessageOwner: boolean;
}) => void;
chatUserId: string;
recipientId: string;
renderChatBubble?: (props: ChatBubbleRenderProps) => void;
layout?: "stacked";
onScrollToIndex: (messageId: string) => void;
isPending?: boolean;
threaded?: boolean;
};
declare const ChatItem: React.ForwardRefExoticComponent<ChatItemProps & React.RefAttributes<unknown>>;
export { ChatItem };