-
-
Notifications
You must be signed in to change notification settings - Fork 215
Expand file tree
/
Copy pathAgreementData.tsx
More file actions
24 lines (20 loc) · 893 Bytes
/
AgreementData.tsx
File metadata and controls
24 lines (20 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import JSONEditor from "../JSONEditor";
import useAppStore from "../../store/store";
import { updateEditorActivity } from "../../ai-assistant/activityTracker";
import * as monaco from "monaco-editor";
function AgreementData({ editorRef }: { editorRef?: React.MutableRefObject<monaco.editor.IStandaloneCodeEditor | null> }) {
const editorAgreementData = useAppStore((state) => state.editorAgreementData);
const setEditorAgreementData = useAppStore((state) => state.setEditorAgreementData);
const setData = useAppStore((state) => state.setData);
const handleChange = (value: string | undefined) => {
if (value !== undefined) {
updateEditorActivity('json');
setEditorAgreementData(value);
void setData(value);
}
};
return (
<JSONEditor value={editorAgreementData} onChange={handleChange} editorRef={editorRef} />
);
}
export default AgreementData;