import { useSelector } from 'react-redux';

import { selectMessage } from '@/store/selector';

function useMessage() {
  const message = useSelector(selectMessage);
  return {
    hasUnread: message.count > 0,
    unReadCount: message.count,
  };
}

export default useMessage;
