-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fetch conversation and delete chat dialog (#69)
* feat: set chat configuration to backend * feat: exclude unEnabled variables * feat: delete chat dialog * feat: fetch conversation
- Loading branch information
Showing
22 changed files
with
783 additions
and
115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum MessageType { | ||
Assistant = 'assistant', | ||
User = 'user', | ||
} |
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,34 @@ | ||
import isEqual from 'lodash/isEqual'; | ||
import { useEffect, useRef, useState } from 'react'; | ||
|
||
export const useSetModalState = () => { | ||
const [visible, setVisible] = useState(false); | ||
|
||
const showModal = () => { | ||
setVisible(true); | ||
}; | ||
const hideModal = () => { | ||
setVisible(false); | ||
}; | ||
|
||
return { visible, showModal, hideModal }; | ||
}; | ||
|
||
export const useDeepCompareEffect = ( | ||
effect: React.EffectCallback, | ||
deps: React.DependencyList, | ||
) => { | ||
const ref = useRef<React.DependencyList>(); | ||
let callback: ReturnType<React.EffectCallback> = () => {}; | ||
if (!isEqual(deps, ref.current)) { | ||
callback = effect(); | ||
ref.current = deps; | ||
} | ||
useEffect(() => { | ||
return () => { | ||
if (callback) { | ||
callback(); | ||
} | ||
}; | ||
}, []); | ||
}; |
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
6 changes: 2 additions & 4 deletions
6
web/src/pages/chat/chat-configuration-modal/assistant-setting.tsx
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,18 @@ | ||
.chatContainer { | ||
padding: 0 24px 24px; | ||
} | ||
|
||
.messageItem { | ||
.messageItemContent { | ||
display: inline-block; | ||
width: 300px; | ||
} | ||
} | ||
|
||
.messageItemLeft { | ||
text-align: left; | ||
} | ||
|
||
.messageItemRight { | ||
text-align: right; | ||
} |
Oops, something went wrong.