Strip the proprietary client EE so the fork ships a clean community/AGPL edition, mirroring Forkmost. Delete apps/client/src/ee (201 files) and packages/ee, and patch every consumer that imported from @/ee/*. - gate-out EE features (useHasFeature -> false): API keys, SSO, MFA, SCIM, audit logs, AI / AI-chat, templates, page permissions, page verification, comment resolution, trash retention, viewer comments - drop cloud/billing/trial/entitlement/posthog flows; sign-in is now email+password only (no SSO/LDAP/cloud) - remove EE routes from App.tsx and EE entries from sidebars/settings nav - restore the community page-share button (ShareModal) that the EE PageShareModal used to provide - remove the dead "Attachments" search filter, dead MFA navigation and orphaned route constants Client type-checks clean; full `pnpm build` is green for all three projects.
62 lines
1.5 KiB
TypeScript
62 lines
1.5 KiB
TypeScript
import { ActionIcon, Menu } from "@mantine/core";
|
|
import { IconDots, IconEdit, IconTrash } from "@tabler/icons-react";
|
|
import { modals } from "@mantine/modals";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
type CommentMenuProps = {
|
|
onEditComment: () => void;
|
|
onDeleteComment: () => void;
|
|
canEdit?: boolean;
|
|
};
|
|
|
|
function CommentMenu({
|
|
onEditComment,
|
|
onDeleteComment,
|
|
canEdit = true,
|
|
}: CommentMenuProps) {
|
|
const { t } = useTranslation();
|
|
|
|
//@ts-ignore
|
|
const openDeleteModal = () =>
|
|
modals.openConfirmModal({
|
|
title: t("Are you sure you want to delete this comment?"),
|
|
centered: true,
|
|
labels: { confirm: t("Delete"), cancel: t("Cancel") },
|
|
confirmProps: { color: "red" },
|
|
onConfirm: onDeleteComment,
|
|
});
|
|
|
|
return (
|
|
<Menu shadow="md" width={200}>
|
|
<Menu.Target>
|
|
<ActionIcon
|
|
variant="default"
|
|
style={{ border: "none" }}
|
|
aria-label={t("Comment menu")}
|
|
>
|
|
<IconDots size={20} stroke={2} />
|
|
</ActionIcon>
|
|
</Menu.Target>
|
|
|
|
<Menu.Dropdown>
|
|
{canEdit && (
|
|
<Menu.Item
|
|
onClick={onEditComment}
|
|
leftSection={<IconEdit size={14} />}
|
|
>
|
|
{t("Edit comment")}
|
|
</Menu.Item>
|
|
)}
|
|
<Menu.Item
|
|
leftSection={<IconTrash size={14} />}
|
|
onClick={openDeleteModal}
|
|
>
|
|
{t("Delete comment")}
|
|
</Menu.Item>
|
|
</Menu.Dropdown>
|
|
</Menu>
|
|
);
|
|
}
|
|
|
|
export default CommentMenu;
|