(logsText: string, filenameSuffix: string)
| 37 | }) => { |
| 38 | const [isDownloading, setIsDownloading] = useState(false); |
| 39 | const downloadLogs = async (logsText: string, filenameSuffix: string) => { |
| 40 | try { |
| 41 | setIsDownloading(true); |
| 42 | const file = new Blob([logsText], { type: "text/plain" }); |
| 43 | await download(file, `${agentName}-${filenameSuffix}.txt`); |
| 44 | } catch (error) { |
| 45 | toast.error(`Failed to download "${agentName}" logs.`, { |
| 46 | description: getErrorDetail(error), |
| 47 | }); |
| 48 | } finally { |
| 49 | setIsDownloading(false); |
| 50 | } |
| 51 | }; |
| 52 | |
| 53 | const hasAllLogs = allLogsText.length > 0; |
| 54 |
no test coverage detected