Spaces:
Paused
Paused
dushyantsingh0 commited on
Commit ·
d1fea2f
1
Parent(s): 12ce592
backend stabilization
Browse files
frontend/packages/shared/src/components/NexusHub.tsx
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
| 14 |
ShieldCheck,
|
| 15 |
Database,
|
| 16 |
ArrowUpRight,
|
| 17 |
-
Edit2,
|
| 18 |
Edit3,
|
| 19 |
Bookmark,
|
| 20 |
BarChart3,
|
|
@@ -166,6 +165,19 @@ export const NexusHub: React.FC<NexusHubProps> = ({ mode = "chat" }) => {
|
|
| 166 |
await updateSavedQuery(editingQueryId, editQueryTitle, editQueryText);
|
| 167 |
setEditingQueryId(null);
|
| 168 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
|
| 170 |
|
| 171 |
const handleSelectThread = (id: string) => {
|
|
@@ -459,7 +471,7 @@ export const NexusHub: React.FC<NexusHubProps> = ({ mode = "chat" }) => {
|
|
| 459 |
<Edit3 size={14} />
|
| 460 |
</button>
|
| 461 |
<button
|
| 462 |
-
onClick={(e) =>
|
| 463 |
style={{ background: 'none', border: 'none', padding: 4, cursor: 'pointer', color: COLORS.gray300 }}
|
| 464 |
>
|
| 465 |
<Trash2 size={14} />
|
|
|
|
| 14 |
ShieldCheck,
|
| 15 |
Database,
|
| 16 |
ArrowUpRight,
|
|
|
|
| 17 |
Edit3,
|
| 18 |
Bookmark,
|
| 19 |
BarChart3,
|
|
|
|
| 165 |
await updateSavedQuery(editingQueryId, editQueryTitle, editQueryText);
|
| 166 |
setEditingQueryId(null);
|
| 167 |
};
|
| 168 |
+
|
| 169 |
+
const handleDeleteQuery = async (e: React.MouseEvent, id: string) => {
|
| 170 |
+
e.stopPropagation();
|
| 171 |
+
const confirmed = await confirm("Are you sure you want to delete this command?", {
|
| 172 |
+
title: "Delete Command",
|
| 173 |
+
confirmLabel: "Delete",
|
| 174 |
+
type: "error",
|
| 175 |
+
danger: true
|
| 176 |
+
});
|
| 177 |
+
if (confirmed) {
|
| 178 |
+
await deleteSavedQuery(id);
|
| 179 |
+
}
|
| 180 |
+
};
|
| 181 |
|
| 182 |
|
| 183 |
const handleSelectThread = (id: string) => {
|
|
|
|
| 471 |
<Edit3 size={14} />
|
| 472 |
</button>
|
| 473 |
<button
|
| 474 |
+
onClick={(e) => handleDeleteQuery(e, q.id)}
|
| 475 |
style={{ background: 'none', border: 'none', padding: 4, cursor: 'pointer', color: COLORS.gray300 }}
|
| 476 |
>
|
| 477 |
<Trash2 size={14} />
|