refactor: playground chat
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Modal, Typography } from 'antd';
|
||||
import React from 'react';
|
||||
import SimpleBar from 'simplebar-react';
|
||||
import 'simplebar-react/dist/simplebar.min.css';
|
||||
import promptList from '../config/prompt';
|
||||
import '../style/prompt-modal.less';
|
||||
|
||||
@@ -33,46 +35,55 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
keyboard={false}
|
||||
width={660}
|
||||
styles={{
|
||||
body: {
|
||||
maxHeight: '550px',
|
||||
overflow: 'auto'
|
||||
content: {
|
||||
padding: '0'
|
||||
},
|
||||
header: {
|
||||
padding: 'var(--ant-modal-content-padding)',
|
||||
marginBottom: '0'
|
||||
}
|
||||
}}
|
||||
footer={null}
|
||||
>
|
||||
<div className="prompt-wrapper">
|
||||
{promptList.map((item, index) => {
|
||||
return (
|
||||
<div key={index} className="prompt-item">
|
||||
<h3 className="title">
|
||||
<span className="text">{item.title}</span>
|
||||
<Button
|
||||
size="middle"
|
||||
type="default"
|
||||
onClick={() => handleSelect(item)}
|
||||
>
|
||||
Use
|
||||
</Button>
|
||||
</h3>
|
||||
{item.data.map((data, i) => {
|
||||
return (
|
||||
<div key={i} className="data-item">
|
||||
<span className="role">{data.role}</span>
|
||||
<span className="prompt">
|
||||
<Typography.Paragraph
|
||||
style={{ margin: 0 }}
|
||||
ellipsis={{ rows: 2, expandable: true, symbol: 'more' }}
|
||||
>
|
||||
{data.content}
|
||||
</Typography.Paragraph>
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<SimpleBar style={{ maxHeight: '550px' }}>
|
||||
<div className="prompt-wrapper">
|
||||
{promptList.map((item, index) => {
|
||||
return (
|
||||
<div key={index} className="prompt-item">
|
||||
<h3 className="title">
|
||||
<span className="text">{item.title}</span>
|
||||
<Button
|
||||
size="middle"
|
||||
type="default"
|
||||
onClick={() => handleSelect(item)}
|
||||
>
|
||||
Use
|
||||
</Button>
|
||||
</h3>
|
||||
{item.data.map((data, i) => {
|
||||
return (
|
||||
<div key={i} className="data-item">
|
||||
<span className="role">{data.role}</span>
|
||||
<span className="prompt">
|
||||
<Typography.Paragraph
|
||||
style={{ margin: 0 }}
|
||||
ellipsis={{
|
||||
rows: 2,
|
||||
expandable: true,
|
||||
symbol: 'more'
|
||||
}}
|
||||
>
|
||||
{data.content}
|
||||
</Typography.Paragraph>
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</SimpleBar>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user