feat(chat): add CanSubmitChat interface and logic to determine chat submission eligibility

This commit is contained in:
Anish Sarkar 2026-07-16 01:29:32 +05:30
parent 7246f89c12
commit 918133a4be

View 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
);
}