From 5575b3f006d71faee9b9559a5f6cc383963ae815 Mon Sep 17 00:00:00 2001 From: Jez Date: Sat, 8 Nov 2025 15:00:24 +1100 Subject: [PATCH] fix: replace alert() with toast notification - Replace browser alert() with toast.error() for better UX - Import toast from react-hot-toast (already in dependencies) - Provides non-blocking, styled error notifications - Consistent with rest of application error handling --- src/modules/todos/components/delete-todo.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/todos/components/delete-todo.tsx b/src/modules/todos/components/delete-todo.tsx index 933ebca..01a5f34 100644 --- a/src/modules/todos/components/delete-todo.tsx +++ b/src/modules/todos/components/delete-todo.tsx @@ -2,6 +2,7 @@ import { Trash2 } from "lucide-react"; import { useState, useTransition } from "react"; +import toast from "react-hot-toast"; import { AlertDialog, AlertDialogAction, @@ -37,7 +38,7 @@ export function DeleteTodo({ todoId }: DeleteTodoProps) { setIsOpen(false); } catch (error) { console.error("Error deleting todo:", error); - alert( + toast.error( `Error deleting todo: ${error instanceof Error ? error.message : "Unknown error"}`, ); }