const a = {
  messages: []
};
function g(e, s) {
  switch (s.type) {
    case "add":
      return {
        ...e,
        messages: [...e.messages, s.message]
      };
    case "remove":
      return {
        ...e,
        messages: e.messages.filter(
          (r) => r.id !== s.messageId
        )
      };
    case "clear":
      return {
        ...e,
        messages: []
      };
    default:
      return e;
  }
}
export {
  a as initialMessagesState,
  g as messagesReducer
};
