diff --git a/src/app/ai/page.tsx b/src/app/ai/page.tsx index b8e5a23..87f7bd5 100644 --- a/src/app/ai/page.tsx +++ b/src/app/ai/page.tsx @@ -26,6 +26,7 @@ export default function AIChatPage() { const [loading, setLoading] = useState(false); const [sidebarOpen, setSidebarOpen] = useState(true); const [error, setError] = useState(""); + const [deleteConfirm, setDeleteConfirm] = useState(null); useEffect(() => { console.log("AI page: childId from useFamily:", childId); @@ -153,6 +154,7 @@ export default function AIChatPage() { try { await fetch(`/api/chat?id=${id}`, { method: "DELETE" }); setSessions(sessions.filter(s => s.id !== id)); + setDeleteConfirm(null); } catch (err) { console.error("Failed to delete:", err); } @@ -184,11 +186,22 @@ export default function AIChatPage() {
{new Date(session.updatedAt).toLocaleDateString()}
+ {deleteConfirm === session.id && ( +
+
+

Delete this conversation?

+
+ + +
+
+
+ )} ))}