Hey is a decentralized and permissionless social media app built with Lens Protocol 馃尶
1import { MenuItem } from "@headlessui/react";
2import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
3import type { PostFragment } from "@hey/indexer";
4import cn from "@/helpers/cn";
5import stopEventPropagation from "@/helpers/stopEventPropagation";
6import { useReportPostModalStore } from "@/store/non-persisted/modal/useReportPostModalStore";
7
8interface ReportProps {
9 post: PostFragment;
10}
11
12const Report = ({ post }: ReportProps) => {
13 const { setShowReportPostModal } = useReportPostModalStore();
14
15 return (
16 <MenuItem
17 as="div"
18 className={({ focus }) =>
19 cn(
20 { "dropdown-active": focus },
21 "m-2 block cursor-pointer rounded-lg px-2 py-1.5 text-red-500 text-sm"
22 )
23 }
24 onClick={(event) => {
25 stopEventPropagation(event);
26 setShowReportPostModal(true, post.id);
27 }}
28 >
29 <div className="flex items-center space-x-2">
30 <ExclamationTriangleIcon className="size-4" />
31 <div>Report post</div>
32 </div>
33 </MenuItem>
34 );
35};
36
37export default Report;