import { PopoverDetail } from '../types';
import { createStore } from './store';

const DEFAULT_POPOVER_DETAIL = {
  messageId: '',
  popoverType: undefined,
};

export const messageItemPopoverStore = createStore(DEFAULT_POPOVER_DETAIL);

export const messageItemPopoverStoreActions = {
  showPopover(args: PopoverDetail) {
    messageItemPopoverStore.set(args);
  },
  hidePopover() {
    messageItemPopoverStore.set(DEFAULT_POPOVER_DETAIL);
  },
};
