@webinex/chatify 1.0.0-alpha04 → 1.0.0-alpha06

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +0,0 @@
1
- import { Account, File } from '../core';
2
- import React from 'react';
3
- export interface MessageMdProps {
4
- author?: Account;
5
- text: string;
6
- files: File[];
7
- my: boolean;
8
- read?: boolean;
9
- sending?: boolean;
10
- reading?: boolean;
11
- timestamp: string;
12
- }
13
- export declare const MessageMd: React.ForwardRefExoticComponent<MessageMdProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,47 +0,0 @@
1
- import { Account, File } from '../core';
2
- import { Avatar } from './Avatar';
3
- import { useLocalizer } from './localizer';
4
- import React from 'react';
5
-
6
- export interface MessageMdProps {
7
- author?: Account;
8
- text: string;
9
- files: File[];
10
- my: boolean;
11
- read?: boolean;
12
- sending?: boolean;
13
- reading?: boolean;
14
- timestamp: string;
15
- }
16
-
17
- export const MessageMd = React.forwardRef(
18
- (props: MessageMdProps, forwardRef: React.ForwardedRef<HTMLDivElement>) => {
19
- const { author, text, my, read, reading, sending, timestamp } = props;
20
- const localizer = useLocalizer();
21
-
22
- return (
23
- <div
24
- ref={forwardRef}
25
- className={'wxchtf-message' + (my ? ' --my' : '') + (sending ? ' --sending' : '')}
26
- >
27
- {author && (
28
- <div className="wxchtf-message-author">
29
- <Avatar account={author} />
30
- </div>
31
- )}
32
- <div className="wxchtf-message-body">
33
- <div className="wxchtf-message-text">{text}</div>
34
- <div className="wxchtf-message-info-box">
35
- <div className="wxchtf-message-sent-at">{localizer.timestamp(timestamp)}</div>
36
- {read !== undefined && !my && (
37
- <div className="wxchtf-message-read-box">
38
- {reading ? localizer.message.reading() : localizer.message.read()}
39
- </div>
40
- )}
41
- {sending && <div className="wxchtf-message-sending-box">{localizer.message.sending()}</div>}
42
- </div>
43
- </div>
44
- </div>
45
- );
46
- },
47
- );