import { createSelector as t } from "@reduxjs/toolkit"
import { CHAT_STATE_KEY as o } from "../chat.constant"
import { CHAT_REACTION_STATE_KEY as e, DEFAULT_REACTIONS as a } from "./chat-reaction.constant"
import { getChatReactionCountById as n } from "../list-view"
export const getChatReactionState = (t) => t[o][e]
export const getChatReactionsById = (t) => (o) => getChatReactionState(o).byId[t] || a
export const getHasReactionsForChatMessage = (o) =>
t([(t) => getChatReactionsById(o)(t), (t) => n(o)(t)], (t, o) => !!(t.reactions?.length > 0 || o))