1- import { Avatar , ChatHeader , Input , TextArea } from '@lobehub/ui' ;
2- import { Button , Slider } from 'antd' ;
1+ import { ChatHeader } from '@lobehub/ui' ;
2+ import { Button } from 'antd' ;
33import { createStyles } from 'antd-style' ;
44import { useTranslation } from 'next-i18next' ;
55import { serverSideTranslations } from 'next-i18next/serverSideTranslations' ;
@@ -8,7 +8,8 @@ import { memo } from 'react';
88import { Flexbox } from 'react-layout-kit' ;
99
1010import ChatLayout from '../../layout' ;
11- import FormItem from './Form' ;
11+ import AgentConfig from './AgentConfig' ;
12+ import AgentMeta from './AgentMeta' ;
1213
1314const useStyles = createStyles ( ( { css, token } ) => ( {
1415 footer : css `
@@ -23,10 +24,6 @@ const useStyles = createStyles(({ css, token }) => ({
2324 background : ${ token . colorBgContainer } ;
2425 border-bottom : 1px solid ${ token . colorSplit } ;
2526 ` ,
26- profile : css `
27- font-size : 20px ;
28- color : ${ token . colorTextTertiary } ;
29- ` ,
3027 title : css `
3128 font-size : 16px ;
3229 font-weight : 500 ;
@@ -36,73 +33,27 @@ const useStyles = createStyles(({ css, token }) => ({
3633const EditPage = memo ( ( ) => {
3734 const { t } = useTranslation ( 'common' ) ;
3835
39- const { styles, theme } = useStyles ( ) ;
36+ const { styles } = useStyles ( ) ;
4037
41- const basic = [
42- { label : t ( 'agentName' ) , placeholder : t ( 'agentNamePlaceholder' ) } ,
43- { label : t ( 'agentDescription' ) , placeholder : t ( 'agentDescriptionPlaceholder' ) } ,
44- { label : t ( 'agentTag' ) , placeholder : t ( 'agentTagPlaceholder' ) } ,
45- ] ;
4638 return (
4739 < ChatLayout >
4840 < Flexbox height = { '100vh' } style = { { position : 'relative' } } width = { '100%' } >
4941 { /*header*/ }
5042 < ChatHeader
5143 left = { < div className = { styles . title } > { t ( 'editAgentProfile' ) } </ div > }
5244 onBackClick = { ( ) => Router . back ( ) }
45+ right = {
46+ < >
47+ < Button > { t ( 'share' ) } </ Button >
48+ < Button type = { 'primary' } > { t ( 'export' ) } </ Button >
49+ </ >
50+ }
5351 showBackButton
5452 />
5553 { /*form*/ }
5654 < Flexbox className = { styles . form } flex = { 1 } gap = { 10 } padding = { 24 } >
57- < FormItem label = { t ( 'agentPrompt' ) } >
58- < TextArea
59- placeholder = { t ( 'agentPromptPlaceholder' ) }
60- // style={{ minHeight: 64 }}
61- type = { 'block' }
62- />
63- </ FormItem >
64-
65- < Flexbox
66- align = { 'center' }
67- distribution = { 'space-between' }
68- horizontal
69- paddingBlock = { 12 }
70- style = { {
71- borderBottom : `1px solid ${ theme . colorBorder } ` ,
72- } }
73- >
74- < Flexbox className = { styles . profile } > { t ( 'profile' ) } </ Flexbox >
75- < Button size = { 'large' } > { t ( 'autoGenerate' ) } </ Button >
76- </ Flexbox >
77- < Flexbox gap = { 80 } horizontal style = { { marginTop : 16 } } >
78- < Flexbox flex = { 1 } gap = { 24 } >
79- { basic . map ( ( item ) => (
80- < FormItem key = { item . label } label = { item . label } >
81- < Input placeholder = { item . placeholder } type = { 'block' } />
82- </ FormItem >
83- ) ) }
84-
85- < Flexbox className = { styles . profile } > { t ( 'advanceSettings' ) } </ Flexbox >
86-
87- < FormItem label = { t ( 'modelTemperature' ) } >
88- < Slider />
89- </ FormItem >
90- </ Flexbox >
91- < FormItem label = { t ( 'agentAvatar' ) } >
92- < Avatar size = { 200 } />
93- </ FormItem >
94- </ Flexbox >
95- </ Flexbox >
96-
97- { /*bottom*/ }
98- < Flexbox
99- className = { styles . footer }
100- direction = { 'horizontal-reverse' }
101- gap = { 8 }
102- padding = { '16px 24px' }
103- >
104- < Button type = { 'primary' } > { t ( 'updateAgent' ) } </ Button >
105- < Button > { t ( 'reset' ) } </ Button >
55+ < AgentMeta />
56+ < AgentConfig />
10657 </ Flexbox >
10758 </ Flexbox >
10859 </ ChatLayout >
0 commit comments