import { atom } from 'jotai';
import {
  askQuestionBtnClickedAtom,
  chatIsOpenAtom,
  chatOnToggleAtom,
  messagesAtom,
  replyEventCategoryAtom,
  responseStreamingAtom,
  suggestionAtom,
  suggestionsAtom,
  suggestionsLoadingAtom,
  userEventsAtom,
  userHasRepliedAtom,
  userQueryAtom,
} from './chatState';

export * from './chatState';
export * from './performanceMetrics';
export * from './form';
export * from './suggestions';
export * from './lastMessage';
export * from './messageQueue';
export * from './renderedWidgetRefs';

export const chatAtom = atom(get => ({
  userHasReplied: get(userHasRepliedAtom),
  replyEventCategory: get(replyEventCategoryAtom),
  userQuery: get(userQueryAtom),
  suggestion: get(suggestionAtom),
  askQuestionBtnClicked: get(askQuestionBtnClickedAtom),
  messages: get(messagesAtom),
  userEvents: get(userEventsAtom),
  suggestions: get(suggestionsAtom),
  suggestionsLoading: get(suggestionsLoadingAtom),
  responseStreaming: get(responseStreamingAtom),
  isOpen: get(chatIsOpenAtom),
  onToggle: get(chatOnToggleAtom),
}));
