1
1
import { Button , Space } from 'antd' ;
2
2
import { createStyles } from 'antd-style' ;
3
3
import { rgba } from 'polished' ;
4
- import { memo , useEffect , useState } from 'react' ;
4
+ import { Suspense , memo , useEffect , useState } from 'react' ;
5
5
import { useTranslation } from 'react-i18next' ;
6
6
import { Flexbox } from 'react-layout-kit' ;
7
7
@@ -13,6 +13,7 @@ import { useChatStore } from '@/store/chat';
13
13
import { chatSelectors } from '@/store/chat/selectors' ;
14
14
import { isMacOS } from '@/utils/platform' ;
15
15
16
+ import MessageFromUrl from './MessageFromUrl' ;
16
17
import SendMore from './SendMore' ;
17
18
import ShortcutHint from './ShortcutHint' ;
18
19
@@ -67,49 +68,54 @@ const Footer = memo<FooterProps>(({ onExpandChange, expand }) => {
67
68
} , [ setIsMac ] ) ;
68
69
69
70
return (
70
- < Flexbox
71
- align = { 'end' }
72
- className = { styles . overrideAntdIcon }
73
- distribution = { 'space-between' }
74
- flex = { 'none' }
75
- gap = { 8 }
76
- horizontal
77
- padding = { '0 24px' }
78
- >
79
- < Flexbox align = { 'center' } gap = { 8 } horizontal style = { { overflow : 'hidden' } } >
80
- { expand && < LocalFiles /> }
81
- </ Flexbox >
82
- < Flexbox align = { 'center' } flex = { 'none' } gap = { 8 } horizontal >
83
- < ShortcutHint />
84
- < SaveTopic />
85
- < Flexbox style = { { minWidth : 92 } } >
86
- { isAIGenerating ? (
87
- < Button
88
- className = { styles . loadingButton }
89
- icon = { < StopLoadingIcon /> }
90
- onClick = { stopGenerateMessage }
91
- >
92
- { t ( 'input.stop' ) }
93
- </ Button >
94
- ) : (
95
- < Space . Compact >
71
+ < >
72
+ < Suspense fallback = { null } >
73
+ < MessageFromUrl />
74
+ </ Suspense >
75
+ < Flexbox
76
+ align = { 'end' }
77
+ className = { styles . overrideAntdIcon }
78
+ distribution = { 'space-between' }
79
+ flex = { 'none' }
80
+ gap = { 8 }
81
+ horizontal
82
+ padding = { '0 24px' }
83
+ >
84
+ < Flexbox align = { 'center' } gap = { 8 } horizontal style = { { overflow : 'hidden' } } >
85
+ { expand && < LocalFiles /> }
86
+ </ Flexbox >
87
+ < Flexbox align = { 'center' } flex = { 'none' } gap = { 8 } horizontal >
88
+ < ShortcutHint />
89
+ < SaveTopic />
90
+ < Flexbox style = { { minWidth : 92 } } >
91
+ { isAIGenerating ? (
96
92
< Button
97
- disabled = { ! canSend }
98
- loading = { ! canSend }
99
- onClick = { ( ) => {
100
- sendMessage ( ) ;
101
- onExpandChange ?.( false ) ;
102
- } }
103
- type = { 'primary' }
93
+ className = { styles . loadingButton }
94
+ icon = { < StopLoadingIcon /> }
95
+ onClick = { stopGenerateMessage }
104
96
>
105
- { t ( 'input.send ' ) }
97
+ { t ( 'input.stop ' ) }
106
98
</ Button >
107
- < SendMore disabled = { ! canSend } isMac = { isMac } />
108
- </ Space . Compact >
109
- ) }
99
+ ) : (
100
+ < Space . Compact >
101
+ < Button
102
+ disabled = { ! canSend }
103
+ loading = { ! canSend }
104
+ onClick = { ( ) => {
105
+ sendMessage ( ) ;
106
+ onExpandChange ?.( false ) ;
107
+ } }
108
+ type = { 'primary' }
109
+ >
110
+ { t ( 'input.send' ) }
111
+ </ Button >
112
+ < SendMore disabled = { ! canSend } isMac = { isMac } />
113
+ </ Space . Compact >
114
+ ) }
115
+ </ Flexbox >
110
116
</ Flexbox >
111
117
</ Flexbox >
112
- </ Flexbox >
118
+ </ >
113
119
) ;
114
120
} ) ;
115
121
0 commit comments