{/* Full transcript */}
{transcript && (
View full transcript{transcriptEntries ? ` (${transcriptEntries} entries)` : ""}
{transcript}
)}
);
}
/**
* Generate Podcast Tool UI Component
*
* This component is registered with assistant-ui to render custom UI
* when the generate_podcast tool is called by the agent.
*
* It fetches the podcast audio with authentication (like the old system)
* and displays it using the Audio component.
*/
export const GeneratePodcastToolUI = makeAssistantToolUI<
GeneratePodcastArgs,
GeneratePodcastResult
>({
toolName: "generate_podcast",
render: function GeneratePodcastUI({ args, result, status }) {
const title = args.podcast_title || "SurfSense Podcast";
// Loading state - podcast is being generated
if (status.type === "running" || status.type === "requires-action") {
return ;
}
// Incomplete/cancelled state
if (status.type === "incomplete") {
if (status.reason === "cancelled") {
return (
Podcast generation cancelled
);
}
if (status.reason === "error") {
return (
);
}
}
// No result yet
if (!result) {
return ;
}
// Error result
if (result.status === "error") {
return ;
}
// Success - need podcast_id to fetch with auth
if (!result.podcast_id) {
return ;
}
// Render the podcast player (handles auth fetch internally)
return (
);
},
});