Files
docmost/apps/client/src/features/comment/components/comment-actions.tsx
T
Philip Okugbe d0ed6865cb fix page level comment on mobile (#2018)
* add icon next to comment box
2026-03-14 01:01:24 +00:00

40 lines
831 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}
onMouseDown={(e) => e.preventDefault()}
>
{t("Save")}
</Button>
</Group>
);
}
export default CommentActions;