fix: Add error handling and display for podcast workflow failures

- Improve error message handling for common API failures
- Add announcementSeverity state for error/success styling
- Display errors with red alert styling in podcast dashboard
This commit is contained in:
ajaysi
2026-03-31 07:52:42 +05:30
parent 004506cf9a
commit 9d04ffb63a
3 changed files with 37 additions and 8 deletions

View File

@@ -177,12 +177,12 @@ const PodcastDashboard: React.FC = () => {
{/* Announcements */}
{workflow.announcement && (
<Alert
severity="info"
severity={workflow.announcementSeverity || "info"}
onClose={() => workflow.setAnnouncement("")}
sx={{
background: "#dbeafe",
border: "1px solid #bfdbfe",
"& .MuiAlert-icon": { color: "#3b82f6" },
background: workflow.announcementSeverity === "error" ? "#fef2f2" : workflow.announcementSeverity === "success" ? "#f0fdf4" : "#dbeafe",
border: `1px solid ${workflow.announcementSeverity === "error" ? "#fecaca" : workflow.announcementSeverity === "success" ? "#bbf7d0" : "#bfdbfe"}`,
"& .MuiAlert-icon": { color: workflow.announcementSeverity === "error" ? "#ef4444" : workflow.announcementSeverity === "success" ? "#22c55e" : "#3b82f6" },
}}
>
{workflow.announcement}