tycho-components 0.0.11-SNAPSHOT-9 → 0.0.11-SNAPSHOT-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ type Props = {
|
|
|
6
6
|
references: Record<string, string | number | boolean>;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
mode: 'lexicon' | 'corpus' | 'parser';
|
|
9
|
-
onChange
|
|
9
|
+
onChange?: (a: Comment[]) => void;
|
|
10
10
|
};
|
|
11
11
|
export default function Comments({ uid, keywords, references, onClose, mode, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -52,7 +52,7 @@ export default function Comments({ uid, keywords, references, onClose, mode, onC
|
|
|
52
52
|
setComment(undefined);
|
|
53
53
|
const updated = [...(comments || []), r.data];
|
|
54
54
|
setComments(updated);
|
|
55
|
-
onChange(updated);
|
|
55
|
+
onChange && onChange(updated);
|
|
56
56
|
createdForm.reset(EMPTY_COMMENT_REQUEST);
|
|
57
57
|
});
|
|
58
58
|
};
|
|
@@ -66,7 +66,7 @@ export default function Comments({ uid, keywords, references, onClose, mode, onC
|
|
|
66
66
|
CommentService.remove(thisComment.id).then(() => {
|
|
67
67
|
const updated = comments?.filter((c) => c.id !== thisComment.id);
|
|
68
68
|
setComments(updated);
|
|
69
|
-
onChange(updated || []);
|
|
69
|
+
onChange && onChange(updated || []);
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
72
|
const handleEdit = (thisComment) => {
|
|
@@ -78,7 +78,7 @@ export default function Comments({ uid, keywords, references, onClose, mode, onC
|
|
|
78
78
|
requestedUser: thisComment.requested?.uid,
|
|
79
79
|
});
|
|
80
80
|
const updated = comments?.map((c) => c.id === thisComment.id ? { ...c, ...thisComment } : c);
|
|
81
|
-
onChange(updated || []);
|
|
81
|
+
onChange && onChange(updated || []);
|
|
82
82
|
};
|
|
83
83
|
const handleUpdate = () => {
|
|
84
84
|
if (!comment)
|