mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-26 23:51:14 +02:00
refactor(chat): enhance Composer component to include active thread state and update footer logic
This commit is contained in:
parent
c415e68bfc
commit
3ec25bd9a4
1 changed files with 7 additions and 3 deletions
|
|
@ -173,7 +173,7 @@ const ThreadContent: FC<ThreadProps> = ({
|
|||
footer={
|
||||
<>
|
||||
<PremiumQuotaPinnedAlert />
|
||||
<Composer isLoadingMessages={isLoadingMessages} />
|
||||
<Composer hasActiveThread={hasActiveThread} isLoadingMessages={isLoadingMessages} />
|
||||
</>
|
||||
}
|
||||
>
|
||||
|
|
@ -531,10 +531,14 @@ const ChatUnavailableNotice: FC<{ workspaceId: number; canConfigure: boolean }>
|
|||
};
|
||||
|
||||
interface ComposerProps {
|
||||
hasActiveThread?: boolean;
|
||||
isLoadingMessages?: boolean;
|
||||
}
|
||||
|
||||
const Composer: FC<ComposerProps> = ({ isLoadingMessages = false }) => {
|
||||
const Composer: FC<ComposerProps> = ({
|
||||
hasActiveThread = false,
|
||||
isLoadingMessages = false,
|
||||
}) => {
|
||||
const [mentionedDocuments, setMentionedDocuments] = useAtom(mentionedDocumentsAtom);
|
||||
const setSubmittedMentions = useSetAtom(submittedMentionsAtom);
|
||||
const [showDocumentPopover, setShowDocumentPopover] = useState(false);
|
||||
|
|
@ -1068,7 +1072,7 @@ const Composer: FC<ComposerProps> = ({ isLoadingMessages = false }) => {
|
|||
/>
|
||||
</div>
|
||||
<ConnectToolsBanner
|
||||
isThreadEmpty={isThreadEmpty && !isLoadingMessages}
|
||||
isThreadEmpty={!hasActiveThread && isThreadEmpty}
|
||||
onVisibleChange={setConnectToolsTrayVisible}
|
||||
/>
|
||||
{!isLoadingMessages && isThreadEmpty && isComposerInputEmpty ? (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue