|
1 | 1 | import { classNames } from '../misc';
|
2 | 2 |
|
3 |
| -const CHATQUICKREPLY_CLASSNAME = 'k-quick-replies'; |
| 3 | +const CHATQUICKREPLIES_CLASSNAME = 'k-quick-replies'; |
4 | 4 |
|
5 | 5 | const states = [];
|
6 | 6 |
|
7 | 7 | const options = {};
|
8 | 8 |
|
9 |
| -const defaultOptions = { |
10 |
| - actions: [ 'Quick', 'Reply', 'Another quick', 'Reply with different length' ] |
11 |
| -}; |
12 |
| - |
13 |
| - |
14 |
| -export type KendoChatQuickRepliesOptions = { |
15 |
| - actions?: Array<string>; |
16 |
| -}; |
| 9 | +const defaultOptions = {}; |
17 | 10 |
|
18 |
| -export const ChatQuickReply = ( |
19 |
| - props: KendoChatQuickRepliesOptions & |
20 |
| - React.HTMLAttributes<HTMLDivElement> |
| 11 | +export const ChatQuickReplies = ( |
| 12 | + props: React.HTMLAttributes<HTMLDivElement> |
21 | 13 | ) => {
|
22 |
| - const { |
23 |
| - actions = defaultOptions.actions, |
24 |
| - ...other |
25 |
| - } = props; |
26 |
| - |
27 |
| - const children: JSX.Element[] = []; |
28 |
| - |
29 |
| - if (actions) { |
30 |
| - actions.map((action, index) => { |
31 |
| - children.push( |
32 |
| - <span className="k-quick-reply" key={index}>{action}</span> |
33 |
| - ); |
34 |
| - }); |
35 |
| - } |
| 14 | + const { ...other } = props; |
36 | 15 |
|
37 | 16 | return (
|
38 | 17 | <div
|
39 | 18 | {...other}
|
40 | 19 | className={classNames(
|
41 |
| - CHATQUICKREPLY_CLASSNAME, |
| 20 | + CHATQUICKREPLIES_CLASSNAME, |
42 | 21 | props.className
|
43 | 22 | )}>
|
44 |
| - {children} |
| 23 | + {props.children} |
45 | 24 | </div>
|
46 | 25 | );
|
47 | 26 | };
|
48 | 27 |
|
49 |
| -ChatQuickReply.states = states; |
50 |
| -ChatQuickReply.options = options; |
51 |
| -ChatQuickReply.className = CHATQUICKREPLY_CLASSNAME; |
52 |
| -ChatQuickReply.defaultOptions = defaultOptions; |
| 28 | +ChatQuickReplies.states = states; |
| 29 | +ChatQuickReplies.options = options; |
| 30 | +ChatQuickReplies.className = CHATQUICKREPLIES_CLASSNAME; |
| 31 | +ChatQuickReplies.defaultOptions = defaultOptions; |
53 | 32 |
|
54 |
| -export default ChatQuickReply; |
| 33 | +export default ChatQuickReplies; |
0 commit comments