@axiom-lattice/react-sdk 2.1.98 → 2.1.99

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.
package/dist/index.js CHANGED
@@ -32088,31 +32088,28 @@ var PersonalAssistantPage = () => {
32088
32088
  enter();
32089
32089
  return () => clearTimeout(timer);
32090
32090
  }, [assistantId, resolveThread]);
32091
- const handleDelete = (0, import_react103.useCallback)(async () => {
32092
- import_antd92.Modal.confirm({
32093
- title: "Delete your personal assistant?",
32094
- content: "This will permanently delete your assistant, all chat history, and your personal project. This action cannot be undone.",
32095
- okText: "Delete Everything",
32096
- okType: "danger",
32097
- cancelText: "Cancel",
32098
- onOk: async () => {
32099
- try {
32100
- await del("/api/personal-assistant");
32101
- setPersonalAssistant(null);
32102
- setChatMode(false);
32103
- setStep(0);
32104
- setName("");
32105
- setPersonalityKey(null);
32106
- setCustomPersonality("");
32107
- import_antd92.message.success("Personal assistant deleted");
32108
- } catch {
32109
- import_antd92.message.error("Network error");
32110
- }
32111
- }
32112
- });
32091
+ const [deleteModalOpen, setDeleteModalOpen] = (0, import_react103.useState)(false);
32092
+ const [deleting, setDeleting] = (0, import_react103.useState)(false);
32093
+ const handleDeleteConfirm = (0, import_react103.useCallback)(async () => {
32094
+ try {
32095
+ setDeleting(true);
32096
+ await del("/api/personal-assistant");
32097
+ setPersonalAssistant(null);
32098
+ setChatMode(false);
32099
+ setStep(0);
32100
+ setName("");
32101
+ setPersonalityKey(null);
32102
+ setCustomPersonality("");
32103
+ import_antd92.message.success("Personal assistant deleted");
32104
+ setDeleteModalOpen(false);
32105
+ } catch {
32106
+ import_antd92.message.error("Network error");
32107
+ } finally {
32108
+ setDeleting(false);
32109
+ }
32113
32110
  }, [del, setPersonalAssistant]);
32114
32111
  const moreItems = [
32115
- { key: "delete", icon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react36.Trash2, { size: 16 }), label: "Delete", danger: true, onClick: handleDelete }
32112
+ { key: "delete", icon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react36.Trash2, { size: 16 }), label: "Delete", danger: true, onClick: () => setDeleteModalOpen(true) }
32116
32113
  ];
32117
32114
  if (chatMode && assistantId && threadId) {
32118
32115
  return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_jsx_runtime120.Fragment, { children: [
@@ -32165,6 +32162,19 @@ var PersonalAssistantPage = () => {
32165
32162
  open: channelModalOpen,
32166
32163
  onClose: () => setChannelModalOpen(false)
32167
32164
  }
32165
+ ),
32166
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
32167
+ import_antd92.Modal,
32168
+ {
32169
+ title: "Delete your personal assistant?",
32170
+ open: deleteModalOpen,
32171
+ onCancel: () => setDeleteModalOpen(false),
32172
+ onOk: handleDeleteConfirm,
32173
+ okText: "Delete Everything",
32174
+ okButtonProps: { danger: true, loading: deleting },
32175
+ cancelText: "Cancel",
32176
+ children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Text50, { children: "This will permanently delete your assistant, all chat history, and your personal project. This action cannot be undone." })
32177
+ }
32168
32178
  )
32169
32179
  ] });
32170
32180
  }