From 9197050ca31740257e9c817484fc29e816232dc8 Mon Sep 17 00:00:00 2001 From: omar rashed Date: Fri, 1 Nov 2024 17:48:05 +0200 Subject: [PATCH] feat: add name of the project --- frontend/components/editor/navbar/downloadButton.tsx | 5 +++-- frontend/components/editor/navbar/index.tsx | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/components/editor/navbar/downloadButton.tsx b/frontend/components/editor/navbar/downloadButton.tsx index 6b2c9c7..c036ffc 100644 --- a/frontend/components/editor/navbar/downloadButton.tsx +++ b/frontend/components/editor/navbar/downloadButton.tsx @@ -3,7 +3,7 @@ import { useSocket } from "@/context/SocketContext" import { Button } from "@/components/ui/button" import { Download } from "lucide-react" -export default function DownloadButton() { +export default function DownloadButton({ name }: { name: string }) { const { socket } = useSocket() const handleDownload = async () => { @@ -18,12 +18,13 @@ export default function DownloadButton() { const url = window.URL.createObjectURL(blob) const a = document.createElement('a') a.href = url - a.download = 'sandbox-files.zip' + a.download = `${name}.zip` a.click() window.URL.revokeObjectURL(url) }) } + return ( - - + ) : null}