mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
d0ed6865cb
* add icon next to comment box
40 lines
831 B
TypeScript
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;
|