refactor(templates): add error toast support to page templates
Update all page templates to accept an optional error message parameter and display it via the ErrorToast component when data loading fails.
This commit is contained in:
@@ -2,7 +2,7 @@ package templates
|
||||
|
||||
import "bookhoard/internal/handlers"
|
||||
|
||||
templ Progress(user User, progressData []handlers.ProgressWithMedia) {
|
||||
templ Progress(user User, progressData []handlers.ProgressWithMedia, errorMessage string) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -108,6 +108,8 @@ templ Progress(user User, progressData []handlers.ProgressWithMedia) {
|
||||
window.location.href = '/login';
|
||||
}
|
||||
</script>
|
||||
|
||||
@ErrorToast(errorMessage)
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user