-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from lobehub/fix/openai-error
feat: 支持助手默认打招呼,优化官方助手,消息栏展示,添加作者和日期
- Loading branch information
Showing
57 changed files
with
729 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { TabsNav } from '@lobehub/ui'; | ||
import React, { useState } from 'react'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
|
||
import Agent from '@/features/Actions/Agent'; | ||
|
||
import { useStyles } from './style'; | ||
|
||
const Index = () => { | ||
const { styles } = useStyles(); | ||
const [tab, setTab] = useState('session'); | ||
|
||
const options = [ | ||
{ key: 'session', label: '对话' }, | ||
{ key: 'character', label: '角色' }, | ||
]; | ||
|
||
return ( | ||
<Flexbox justify={'space-between'} horizontal align={'center'} className={styles.header}> | ||
<TabsNav items={options} size="small" activeKey={tab} onChange={setTab} variant={'compact'} /> | ||
<Agent key={'agent'} /> | ||
</Flexbox> | ||
); | ||
}; | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createStyles } from 'antd-style'; | ||
|
||
const useStyles = createStyles(({ token, css }) => ({ | ||
header: css` | ||
padding: ${token.paddingXS}px; | ||
`, | ||
})); | ||
|
||
export { useStyles }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { DraggablePanel } from '@lobehub/ui'; | ||
import { createStyles } from 'antd-style'; | ||
|
||
import { SIDEBAR_MAX_WIDTH, SIDEBAR_WIDTH } from '@/constants/common'; | ||
import SessionList from '@/features/SessionList'; | ||
import { useGlobalStore } from '@/store/global'; | ||
|
||
const useStyles = createStyles(({ css }) => ({ | ||
sidebar: css` | ||
display: flex; | ||
flex-direction: column; | ||
`, | ||
})); | ||
|
||
const SideBar = () => { | ||
const { styles } = useStyles(); | ||
const [showSessionList, setSessionList] = useGlobalStore((s) => [ | ||
s.showSessionList, | ||
s.setSessionList, | ||
]); | ||
|
||
return ( | ||
<DraggablePanel | ||
className={styles.sidebar} | ||
maxWidth={SIDEBAR_MAX_WIDTH} | ||
minWidth={SIDEBAR_WIDTH} | ||
mode={'fixed'} | ||
placement={'left'} | ||
onExpandChange={(expand) => setSessionList(expand)} | ||
expand={showSessionList} | ||
> | ||
{/*<Header />*/} | ||
<SessionList /> | ||
</DraggablePanel> | ||
); | ||
}; | ||
|
||
export default SideBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Space, Typography } from 'antd'; | ||
import { createStyles } from 'antd-style'; | ||
import React, { memo } from 'react'; | ||
|
||
const { Link } = Typography; | ||
const useStyles = createStyles(({ css, token }) => ({ | ||
author: css` | ||
font-size: ${token.fontSizeSM}px; | ||
`, | ||
date: css` | ||
font-size: ${token.fontSizeSM}px; | ||
color: ${token.colorTextDescription}; | ||
`, | ||
})); | ||
|
||
interface Props { | ||
item?: { author: string; createAt: string; homepage: string }; | ||
} | ||
|
||
export default memo((props: Props) => { | ||
const { item } = props; | ||
|
||
const { styles } = useStyles(); | ||
return ( | ||
<Space> | ||
<Link | ||
aria-label={item?.author} | ||
className={styles.author} | ||
href={item?.homepage} | ||
target={'_blank'} | ||
> | ||
@{item?.author} | ||
</Link> | ||
<div className={styles.date}>{item?.createAt}</div> | ||
</Space> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.