Files
docmost/apps/client/src/features/comment/components/comment-actions.tsx
T
fuscodev e3ba817723 feat: comment editor emoji picker and ctrl+enter action (#1121)
* commenteditor-emoji-picker

* capture Mac command key
* remove tooltip

---------

Co-authored-by: Philipinho <16838612+Philipinho@users.noreply.github.com>
2025-05-16 20:01:27 +01:00

35 lines
752 B
TypeScript

import { Button, Group, Tooltip } from "@mantine/core";
import { useTranslation } from "react-i18next";
type CommentActionsProps = {
onSave: () => void;
isLoading?: boolean;
onCancel?: () => void;
isCommentEditor?: boolean;
};
function CommentActions({
onSave,
isLoading,
onCancel,
isCommentEditor,
}: CommentActionsProps) {
const { t } = useTranslation();
return (
<Group justify="flex-end" pt="sm" wrap="nowrap">
{isCommentEditor && (
<Button size="compact-sm" variant="default" onClick={onCancel}>
{t("Cancel")}
</Button>
)}
<Button size="compact-sm" loading={isLoading} onClick={onSave}>
{t("Save")}
</Button>
</Group>
);
}
export default CommentActions;