2024-05-14 08:56:54 +00:00
|
|
|
import { useParams } from "next/navigation";
|
2024-03-19 14:38:35 +00:00
|
|
|
import { IssueEmojiReactions, IssueVotes } from "@/components/issues/peek-overview";
|
2024-05-14 08:56:54 +00:00
|
|
|
import { useProject } 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
|
|
|
|
|
|
|
// type IssueReactionsProps = {
|
|
|
|
// workspaceSlug: string;
|
|
|
|
// projectId: string;
|
|
|
|
// };
|
2023-09-01 11:12:30 +00:00
|
|
|
|
|
|
|
export const IssueReactions: React.FC = () => {
|
2024-05-14 08:56:54 +00:00
|
|
|
const { workspace_slug: workspaceSlug, project_id: projectId } = useParams<any>();
|
|
|
|
|
|
|
|
const { canVote, canReact } = useProject();
|
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 && (
|
2023-09-01 11:12:30 +00:00
|
|
|
<>
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className="flex items-center gap-2">
|
2024-05-17 12:21:14 +00:00
|
|
|
<IssueVotes workspaceSlug={workspaceSlug} projectId={projectId} />
|
2023-09-01 11:12:30 +00:00
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
)}
|
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-05-14 08:56:54 +00:00
|
|
|
<IssueEmojiReactions workspaceSlug={workspaceSlug} projectId={projectId} />
|
2023-09-01 11:12:30 +00:00
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|