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:
1 parent
7c652d5a3a
commit
0c515a277c
22 files changed
+198
-142
No files matched your search
@@ -2,7 +2,7 @@ package templates
|
||||
|
||||
import "bookhoard/internal/handlers"
|
||||
|
||||
templ Devices(user User, devices []handlers.DeviceInfo, pendingRegistrations []PendingRegistrationData, baseURL string) {
|
||||
templ Devices(user User, devices []handlers.DeviceInfo, pendingRegistrations []PendingRegistrationData, errorMessage string, baseURL string) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -863,6 +863,8 @@ templ Devices(user User, devices []handlers.DeviceInfo, pendingRegistrations []P
|
||||
// Load devices on page load
|
||||
loadDevices();
|
||||
</script>
|
||||
|
||||
@ErrorToast(errorMessage)
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
Reference in new issue
Block a user