mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
feat: replace download icons, replace loader2 with our custom spinner in report panel export options
This commit is contained in:
parent
4111e5d1cc
commit
60c3d43033
1 changed files with 5 additions and 11 deletions
|
|
@ -5,9 +5,7 @@ import {
|
||||||
CheckIcon,
|
CheckIcon,
|
||||||
ChevronDownIcon,
|
ChevronDownIcon,
|
||||||
ClipboardIcon,
|
ClipboardIcon,
|
||||||
DownloadIcon,
|
|
||||||
FileTextIcon,
|
FileTextIcon,
|
||||||
Loader2Icon,
|
|
||||||
XIcon,
|
XIcon,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
|
|
@ -17,6 +15,7 @@ import {
|
||||||
reportPanelAtom,
|
reportPanelAtom,
|
||||||
} from "@/atoms/chat/report-panel.atom";
|
} from "@/atoms/chat/report-panel.atom";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { Spinner } from "@/components/ui/spinner";
|
||||||
import {
|
import {
|
||||||
Drawer,
|
Drawer,
|
||||||
DrawerContent,
|
DrawerContent,
|
||||||
|
|
@ -280,7 +279,6 @@ function ReportPanelContent({
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="start" className={`min-w-[180px]${insideDrawer ? " z-[100]" : ""}`}>
|
<DropdownMenuContent align="start" className={`min-w-[180px]${insideDrawer ? " z-[100]" : ""}`}>
|
||||||
<DropdownMenuItem onClick={() => handleExport("md")}>
|
<DropdownMenuItem onClick={() => handleExport("md")}>
|
||||||
<DownloadIcon className="size-4" />
|
|
||||||
Download Markdown
|
Download Markdown
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
{/* PDF/DOCX export requires server-side conversion via authenticated endpoint.
|
{/* PDF/DOCX export requires server-side conversion via authenticated endpoint.
|
||||||
|
|
@ -291,10 +289,8 @@ function ReportPanelContent({
|
||||||
onClick={() => handleExport("pdf")}
|
onClick={() => handleExport("pdf")}
|
||||||
disabled={exporting !== null}
|
disabled={exporting !== null}
|
||||||
>
|
>
|
||||||
{exporting === "pdf" ? (
|
{exporting === "pdf" && (
|
||||||
<Loader2Icon className="size-4 animate-spin" />
|
<Spinner size="xs" />
|
||||||
) : (
|
|
||||||
<DownloadIcon className="size-4" />
|
|
||||||
)}
|
)}
|
||||||
Download PDF
|
Download PDF
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
|
|
@ -302,10 +298,8 @@ function ReportPanelContent({
|
||||||
onClick={() => handleExport("docx")}
|
onClick={() => handleExport("docx")}
|
||||||
disabled={exporting !== null}
|
disabled={exporting !== null}
|
||||||
>
|
>
|
||||||
{exporting === "docx" ? (
|
{exporting === "docx" && (
|
||||||
<Loader2Icon className="size-4 animate-spin" />
|
<Spinner size="xs" />
|
||||||
) : (
|
|
||||||
<DownloadIcon className="size-4" />
|
|
||||||
)}
|
)}
|
||||||
Download DOCX
|
Download DOCX
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue