import { Menu, MenuButton, MenuItems } from "@headlessui/react"; import { EllipsisHorizontalIcon } from "@heroicons/react/24/outline"; import type { PostFragment } from "@hey/indexer"; import { Fragment } from "react"; import MenuTransition from "@/components/Shared/MenuTransition"; import cn from "@/helpers/cn"; import stopEventPropagation from "@/helpers/stopEventPropagation"; import { useAccountStore } from "@/store/persisted/useAccountStore"; import Bookmark from "./Bookmark"; import CopyPostText from "./CopyPostText"; import Delete from "./Delete"; import Edit from "./Edit"; import HideComment from "./HideComment"; import NotInterested from "./NotInterested"; import Report from "./Report"; import Share from "./Share"; interface PostMenuProps { post: PostFragment; } const PostMenu = ({ post }: PostMenuProps) => { const { currentAccount } = useAccountStore(); const canEdit = post.operations?.canEdit.__typename === "PostOperationValidationPassed"; const iconClassName = "w-[15px] sm:w-[18px]"; return ( {currentAccount ? ( <>
) : null}
{currentAccount?.address === post?.author?.address ? ( <> {canEdit && currentAccount?.hasSubscribed ? ( ) : null} ) : ( )}
); }; export default PostMenu;