Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

807 B
Raw Blame
import { type InputCompletionError, type SendButtonProps, type State } from './initialState';
import { initialSendButtonState } from './initialState';

export const selectors = {
  inputCompletionError: (s: State): InputCompletionError | undefined => s.inputCompletionError,
  inputCompletionErrorVisible: (s: State): InputCompletionError | undefined =>
    s.inputCompletionErrorDismissed ? undefined : s.inputCompletionError,
  inputCompletionPaused: (s: State): boolean => Boolean(s.inputCompletionError),
  /** A send from the draft on screen is waiting for its uploads to settle. */
  isSendQueuedForUploads: (s: State): boolean =>
    !!s.uploadQueuedSend && s.uploadQueuedSend.draftKey === s.draftKey,
  sendButtonProps: (s: State): SendButtonProps => s.sendButtonProps || initialSendButtonState,
};