+
{workspaceMemoRelatedSetting.reactions.map((reactionType) => {
return (
handleReactionClick(reactionType)}
diff --git a/web/src/components/Settings/MemoRelatedSettings.tsx b/web/src/components/Settings/MemoRelatedSettings.tsx
index 6e90740e..52023d30 100644
--- a/web/src/components/Settings/MemoRelatedSettings.tsx
+++ b/web/src/components/Settings/MemoRelatedSettings.tsx
@@ -1,5 +1,6 @@
-import { Button, Input, Switch, Select, Option } from "@mui/joy";
-import { isEqual } from "lodash-es";
+import { Button, Input, Switch, Select, Option, Chip, ChipDelete } from "@mui/joy";
+import { isEqual, uniq } from "lodash-es";
+import { CheckIcon } from "lucide-react";
import { useState } from "react";
import { toast } from "react-hot-toast";
import { workspaceSettingNamePrefix, useWorkspaceSettingStore } from "@/store/v1";
@@ -17,6 +18,7 @@ const MemoRelatedSettings = () => {
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.MEMO_RELATED)?.memoRelatedSetting || {},
);
const [memoRelatedSetting, setMemoRelatedSetting] = useState(originalSetting);
+ const [editingReaction, setEditingReaction] = useState("");
const updatePartialSetting = (partial: Partial) => {
const newWorkspaceMemoRelatedSetting = WorkspaceMemoRelatedSetting.fromPartial({
@@ -26,7 +28,21 @@ const MemoRelatedSettings = () => {
setMemoRelatedSetting(newWorkspaceMemoRelatedSetting);
};
+ const upsertReaction = () => {
+ if (!editingReaction) {
+ return;
+ }
+
+ updatePartialSetting({ reactions: uniq([...memoRelatedSetting.reactions, editingReaction.trim()]) });
+ setEditingReaction("");
+ };
+
const updateSetting = async () => {
+ if (memoRelatedSetting.reactions.length === 0) {
+ toast.error("Reactions must not be empty.");
+ return;
+ }
+
try {
await workspaceSettingStore.setWorkspaceSetting({
name: `${workspaceSettingNamePrefix}${WorkspaceSettingKey.MEMO_RELATED}`,
@@ -120,6 +136,41 @@ const MemoRelatedSettings = () => {
))}
+
+
Reactions
+
+ {memoRelatedSetting.reactions.map((reactionType) => {
+ return (
+ updatePartialSetting({ reactions: memoRelatedSetting.reactions.filter((r) => r !== reactionType) })}
+ />
+ }
+ >
+ {reactionType}
+
+ );
+ })}
+ setEditingReaction(event.target.value.trim())}
+ endDecorator={
+ upsertReaction()}
+ />
+ }
+ />
+
+