Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite164f09

Browse files
committed
add custom loader
1 parentdbfda30 commite164f09

File tree

1 file changed

+34
-2
lines changed
  • client/packages/lowcoder/src/comps/comps/chatComp/components/assistant-ui

1 file changed

+34
-2
lines changed

‎client/packages/lowcoder/src/comps/comps/chatComp/components/assistant-ui/thread.tsx

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,42 @@ import {
2121
import{Button}from"../ui/button";
2222
import{MarkdownText}from"./markdown-text";
2323
import{TooltipIconButton}from"./tooltip-icon-button";
24+
import{Spin,Flex}from"antd";
25+
import{LoadingOutlined}from"@ant-design/icons";
26+
importstyledfrom"styled-components";
27+
constSimpleANTDLoader=()=>{
28+
constantIcon=<LoadingOutlinedstyle={{fontSize:24}}spin/>;
29+
30+
return(
31+
<divstyle={{textAlign:'left',width:'100%'}}>
32+
<Flexalign="center"gap={12}style={{paddingLeft:'16px'}}>
33+
<Spinindicator={antIcon}size="small"/>
34+
<spanstyle={{color:'#666',fontSize:'14px'}}>Working on it...</span>
35+
</Flex>
36+
</div>
37+
);
38+
};
39+
40+
constStyledThreadRoot=styled(ThreadPrimitive.Root)`
41+
/* Hide entire assistant message container when it contains running status */
42+
.aui-assistant-message-root:has([data-status="running"]) {
43+
display: none;
44+
}
45+
46+
/* Fallback for older browsers that don't support :has() */
47+
.aui-assistant-message-content [data-status="running"] {
48+
display: none;
49+
}
50+
`;
51+
2452

2553
interfaceThreadProps{
2654
placeholder?:string;
2755
}
2856

2957
exportconstThread:FC<ThreadProps>=({ placeholder="Write a message..."})=>{
3058
return(
31-
<ThreadPrimitive.Root
59+
<StyledThreadRoot
3260
className="aui-root aui-thread-root"
3361
style={{
3462
["--thread-max-width"asstring]:"42rem",
@@ -44,6 +72,10 @@ import {
4472
AssistantMessage:AssistantMessage,
4573
}}
4674
/>
75+
76+
<ThreadPrimitive.Ifrunning>
77+
<SimpleANTDLoader/>
78+
</ThreadPrimitive.If>
4779

4880
<ThreadPrimitive.Ifempty={false}>
4981
<divclassName="aui-thread-viewport-spacer"/>
@@ -54,7 +86,7 @@ import {
5486
<Composerplaceholder={placeholder}/>
5587
</div>
5688
</ThreadPrimitive.Viewport>
57-
</ThreadPrimitive.Root>
89+
</StyledThreadRoot>
5890
);
5991
};
6092

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp