This commit is contained in:
Philipinho
2026-02-01 11:16:38 +00:00
parent 56f476649c
commit 483e39db1c
6 changed files with 19 additions and 23 deletions
@@ -8,7 +8,7 @@ import { Decoration, DecorationSet } from "@tiptap/pm/view";
import historyClasses from "./history.module.css";
import { recreateTransform } from "@docmost/editor-ext";
import { DOMSerializer, Node } from "@tiptap/pm/model";
import { ChangeSet, simplifyChanges } from "prosemirror-changeset";
import { ChangeSet, simplifyChanges } from "@tiptap/pm/changeset";
import { useAtom } from "jotai";
import {
diffCountsAtom,
@@ -19,12 +19,14 @@ import {
import HistoryView from "@/features/page-history/components/history-view";
import { useEffect, useRef, useState } from "react";
import { IconChevronUp, IconChevronDown } from "@tabler/icons-react";
import { useTranslation } from "react-i18next";
interface Props {
pageId: string;
}
export default function HistoryModalBody({ pageId }: Props) {
const { t } = useTranslation();
const [activeHistoryId, setActiveHistoryId] = useAtom(activeHistoryIdAtom);
const [activeHistoryPrevId, setActiveHistoryPrevId] = useAtom(
activeHistoryPrevIdAtom,
@@ -125,11 +127,12 @@ export default function HistoryModalBody({ pageId }: Props) {
</Group>
)}
<Switch
label="Highlight changes"
label={t("Highlight changes")}
checked={highlightChanges}
onChange={(e) => setHighlightChanges(e.currentTarget.checked)}
style={{ userSelect: "none" }}
/>
{diffCounts && diffCounts.total > 0 && (
{highlightChanges && diffCounts && diffCounts.total > 0 && (
<Group gap="xs">
<Text size="sm" c="dimmed">
{currentChangeIndex} of {diffCounts.total}