Skip to content

Commit a3c663a

Browse files
committed
fix: download csv file
1 parent 92aeef6 commit a3c663a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/DownloadFileButton.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type DownloadFileButtonProps = ButtonProps & {
88
| MediaSource
99
| {
1010
text: string
11-
mimeType: "plain"
11+
mimeType: "plain" | "csv"
1212
name: string
1313
charset?: string
1414
extension?: string
@@ -26,7 +26,7 @@ const DownloadFileButton: FC<DownloadFileButtonProps> = ({
2626
if ("mimeType" in file) {
2727
let { text, mimeType, name, charset = "utf-8", extension } = file
2828

29-
if (!extension) extension = "." + { plain: "txt" }[mimeType]
29+
if (!extension) extension = "." + { plain: "txt", csv: "csv" }[mimeType]
3030

3131
anchorProps = {
3232
download: name + extension,

0 commit comments

Comments
 (0)