Spaces:
Sleeping
Sleeping
Upload index.tsx
Browse files
aworld/cmd/web/webui/src/pages/components/Prompts/index.tsx
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import {
|
2 |
+
Prompts as AntDesignPrompts,
|
3 |
+
} from '@ant-design/x';
|
4 |
+
|
5 |
+
import './index.less';
|
6 |
+
|
7 |
+
interface IPromptsProps {
|
8 |
+
items: any[];
|
9 |
+
onItemClick: (item: any) => void;
|
10 |
+
className?: string;
|
11 |
+
}
|
12 |
+
|
13 |
+
const Prompts = (props: IPromptsProps) => {
|
14 |
+
const { items, onItemClick, className } = props;
|
15 |
+
return (
|
16 |
+
<AntDesignPrompts
|
17 |
+
items={items}
|
18 |
+
styles={{
|
19 |
+
item: {
|
20 |
+
flex: 1,
|
21 |
+
backgroundImage: 'linear-gradient(123deg, #e5f4ff 0%, #efe7ff 100%)',
|
22 |
+
borderRadius: 12,
|
23 |
+
border: 'none',
|
24 |
+
},
|
25 |
+
subItem: { background: '#ffffffa6' },
|
26 |
+
}}
|
27 |
+
onItemClick={(info) => {
|
28 |
+
onItemClick(info.data.description as string )
|
29 |
+
}}
|
30 |
+
className={className || "chatPrompt"}
|
31 |
+
|
32 |
+
/>
|
33 |
+
)
|
34 |
+
}
|
35 |
+
|
36 |
+
export default Prompts;
|