diff --git a/src/app/(dashboard)/jobs/[jobId]/components/job-files-panel.tsx b/src/app/(dashboard)/jobs/[jobId]/components/job-files-panel.tsx index 2b99eeb..0342c70 100644 --- a/src/app/(dashboard)/jobs/[jobId]/components/job-files-panel.tsx +++ b/src/app/(dashboard)/jobs/[jobId]/components/job-files-panel.tsx @@ -242,6 +242,7 @@ function FileRow({ file }: { file: JobFileWithUrl }) { ); const [, startTransition] = useTransition(); const [open, setOpen] = useState(false); + const [downloadOpen, setDownloadOpen] = useState(false); useEffect(() => { if (state.ok) { @@ -252,6 +253,20 @@ function FileRow({ file }: { file: JobFileWithUrl }) { } }, [state]); + function triggerDownload() { + // Use a programmatic anchor click — the server route streams the file + // with Content-Disposition: attachment, so the browser hands it straight + // to the download manager. Toast confirms it left our side. + const a = document.createElement("a"); + a.href = file.url; + a.download = file.name; + document.body.appendChild(a); + a.click(); + a.remove(); + setDownloadOpen(false); + toast.success("İndirme başladı.", { description: file.name }); + } + return (
  • {kindIcon(file.kind)} @@ -264,11 +279,31 @@ function FileRow({ file }: { file: JobFileWithUrl }) { {JOB_FILE_KIND_LABELS[file.kind] ?? file.kind} - + + + + Dosya indirilsin mi? + + {file.name} + · {formatSize(file.size)} + + + + + + + + + +