mirror of
https://git.mirrors.martin98.com/https://github.com/bytedance/deer-flow
synced 2025-08-17 11:35:54 +08:00
feat: add download
button
This commit is contained in:
parent
2f06f0c433
commit
c57fa8fdd8
@ -376,8 +376,8 @@ function PodcastCard({
|
|||||||
const data = useMemo(() => {
|
const data = useMemo(() => {
|
||||||
return parse(message.content ?? "");
|
return parse(message.content ?? "");
|
||||||
}, [message.content]);
|
}, [message.content]);
|
||||||
const title = useMemo(() => data?.title, [data]);
|
const title = useMemo<string | undefined>(() => data?.title, [data]);
|
||||||
const audioUrl = useMemo(() => data?.audioUrl, [data]);
|
const audioUrl = useMemo<string | undefined>(() => data?.audioUrl, [data]);
|
||||||
const isGenerating = useMemo(() => {
|
const isGenerating = useMemo(() => {
|
||||||
return message.isStreaming;
|
return message.isStreaming;
|
||||||
}, [message.isStreaming]);
|
}, [message.isStreaming]);
|
||||||
@ -396,16 +396,23 @@ function PodcastCard({
|
|||||||
: "Podcast"}
|
: "Podcast"}
|
||||||
</RainbowText>
|
</RainbowText>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
{!isGenerating && (
|
||||||
<Tooltip>
|
<div className="flex">
|
||||||
<TooltipTrigger asChild>
|
<Tooltip>
|
||||||
<Button variant="ghost" size="icon">
|
<TooltipTrigger asChild>
|
||||||
<DownloadOutlined />
|
<Button variant="ghost" size="icon" asChild>
|
||||||
</Button>
|
<a
|
||||||
</TooltipTrigger>
|
href={audioUrl}
|
||||||
<TooltipContent>Download podcast</TooltipContent>
|
download={`${(title ?? "podcast").replaceAll(" ", "-")}.mp3`}
|
||||||
</Tooltip>
|
>
|
||||||
</div>
|
<DownloadOutlined />
|
||||||
|
</a>
|
||||||
|
</Button>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>Download podcast</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<CardTitle>
|
<CardTitle>
|
||||||
<div className="text-lg font-medium">
|
<div className="text-lg font-medium">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user