import { FC } from "react"; // components import { IssueReactionPreview, IssueReactionSelector } from "./"; interface IIssueReaction { issueReactions: any; user: any; issueReactionCreate: (reaction: string) => void; issueReactionRemove: (reaction: string) => void; position?: "top" | "bottom"; } export const IssueReaction: FC = (props) => { const { issueReactions, user, issueReactionCreate, issueReactionRemove, position = "bottom" } = props; const handleReaction = (reaction: string) => { const isReactionAvailable = issueReactions[reaction].find((_reaction: any) => _reaction.actor === user?.id) ?? false; if (isReactionAvailable) issueReactionRemove(reaction); else issueReactionCreate(reaction); }; return (
); };