2024-06-05 14:38:03 +00:00
|
|
|
import { observer } from "mobx-react-lite";
|
2024-03-19 14:38:35 +00:00
|
|
|
import { IssueEmojiReactions, IssueVotes } from "@/components/issues/peek-overview";
|
2024-06-05 14:38:03 +00:00
|
|
|
// hooks
|
|
|
|
import { usePublish } from "@/hooks/store";
|
2024-05-22 07:09:34 +00:00
|
|
|
import useIsInIframe from "@/hooks/use-is-in-iframe";
|
2024-05-14 08:56:54 +00:00
|
|
|
|
2024-06-05 14:38:03 +00:00
|
|
|
type Props = {
|
|
|
|
anchor: string;
|
|
|
|
};
|
2024-05-14 08:56:54 +00:00
|
|
|
|
2024-06-05 14:38:03 +00:00
|
|
|
export const IssueReactions: React.FC<Props> = observer((props) => {
|
|
|
|
const { anchor } = props;
|
|
|
|
// store hooks
|
|
|
|
const { canVote, canReact } = usePublish(anchor);
|
2024-05-22 07:09:34 +00:00
|
|
|
const isInIframe = useIsInIframe();
|
2023-09-01 11:12:30 +00:00
|
|
|
|
|
|
|
return (
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className="mt-4 flex items-center gap-3">
|
2024-05-14 08:56:54 +00:00
|
|
|
{canVote && (
|
2024-06-05 14:38:03 +00:00
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
<IssueVotes anchor={anchor} />
|
|
|
|
</div>
|
2023-09-01 11:12:30 +00:00
|
|
|
)}
|
2024-05-22 07:09:34 +00:00
|
|
|
{!isInIframe && canReact && (
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className="flex items-center gap-2">
|
2024-06-05 14:38:03 +00:00
|
|
|
<IssueEmojiReactions anchor={anchor} />
|
2023-09-01 11:12:30 +00:00
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
);
|
2024-06-05 14:38:03 +00:00
|
|
|
});
|