Browse Source

fix(web): Sidebar create new chat context (#1569)

tags/0.3.31
Rhon Joe 1 year ago
parent
commit
ac3496e681
No account linked to committer's email address

+ 1
- 0
web/app/components/share/chat/index.tsx View File

onUnpin={handleUnpin} onUnpin={handleUnpin}
controlUpdateList={controlUpdateConversationList} controlUpdateList={controlUpdateConversationList}
onDelete={handleDelete} onDelete={handleDelete}
onStartChat={handleStartChat}
/> />
) )
} }

+ 3
- 1
web/app/components/share/chat/sidebar/index.tsx View File

onUnpin: (id: string) => void onUnpin: (id: string) => void
controlUpdateList: number controlUpdateList: number
onDelete: (id: string) => void onDelete: (id: string) => void
onStartChat: (inputs: Record<string, any>) => void
} }


const Sidebar: FC<ISidebarProps> = ({ const Sidebar: FC<ISidebarProps> = ({
onUnpin, onUnpin,
controlUpdateList, controlUpdateList,
onDelete, onDelete,
onStartChat,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const [hasPinned, setHasPinned] = useState(false) const [hasPinned, setHasPinned] = useState(false)
)} )}
<div className="flex flex-shrink-0 p-4 !pb-0"> <div className="flex flex-shrink-0 p-4 !pb-0">
<Button <Button
onClick={() => { onCurrentIdChange('-1') }}
onClick={() => onStartChat({})}
className="group block w-full flex-shrink-0 !justify-start !h-9 text-primary-600 items-center text-sm"> className="group block w-full flex-shrink-0 !justify-start !h-9 text-primary-600 items-center text-sm">
<PencilSquareIcon className="mr-2 h-4 w-4" /> {t('share.chat.newChat')} <PencilSquareIcon className="mr-2 h-4 w-4" /> {t('share.chat.newChat')}
</Button> </Button>

Loading…
Cancel
Save