mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-26 23:51:14 +02:00
feat(chat): add CanSubmitChat interface and logic to determine chat submission eligibility
This commit is contained in:
parent
7246f89c12
commit
918133a4be
1 changed files with 23 additions and 0 deletions
23
surfsense_web/lib/chat/can-submit-chat.ts
Normal file
23
surfsense_web/lib/chat/can-submit-chat.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
export interface CanSubmitChatInput {
|
||||
isLoadingMessages: boolean;
|
||||
isThreadRunning: boolean;
|
||||
isBlockedByOtherUser: boolean;
|
||||
isComposerEmpty: boolean;
|
||||
isWorkspaceChatReady: boolean;
|
||||
}
|
||||
|
||||
export function canSubmitChat({
|
||||
isLoadingMessages,
|
||||
isThreadRunning,
|
||||
isBlockedByOtherUser,
|
||||
isComposerEmpty,
|
||||
isWorkspaceChatReady,
|
||||
}: CanSubmitChatInput): boolean {
|
||||
return (
|
||||
!isLoadingMessages &&
|
||||
!isThreadRunning &&
|
||||
!isBlockedByOtherUser &&
|
||||
!isComposerEmpty &&
|
||||
isWorkspaceChatReady
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue