mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
update download buttons text
This commit is contained in:
parent
bc6af3a839
commit
5b415e615c
@ -1,4 +1,5 @@
|
||||
import {
|
||||
ComputeResultType,
|
||||
downloadFileBrowser,
|
||||
LoggerInstance,
|
||||
Provider
|
||||
@ -21,6 +22,28 @@ export default function Results({
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const isFinished = job.dateFinished !== null
|
||||
|
||||
function getDownloadButtonValue(type: ComputeResultType): String {
|
||||
let buttonName
|
||||
switch (type) {
|
||||
case 'output':
|
||||
buttonName = 'Download results'
|
||||
break
|
||||
case 'algorithmLog':
|
||||
buttonName = 'Download algorithm logs'
|
||||
break
|
||||
case 'configrationLog':
|
||||
buttonName = 'Download configuration logs'
|
||||
break
|
||||
case 'publishLog':
|
||||
buttonName = 'Download publish logs'
|
||||
break
|
||||
default:
|
||||
buttonName = 'Download results'
|
||||
break
|
||||
}
|
||||
return buttonName
|
||||
}
|
||||
|
||||
async function downloadResults(resultIndex: number) {
|
||||
if (!accountId || !job) return
|
||||
|
||||
@ -56,7 +79,7 @@ export default function Results({
|
||||
onClick={() => downloadResults(i)}
|
||||
disabled={isLoading || !isFinished}
|
||||
>
|
||||
{`Download ${jobResult.filename}`}
|
||||
{getDownloadButtonValue(jobResult.type)}
|
||||
</Button>
|
||||
</ListItem>
|
||||
) : (
|
||||
|
Loading…
Reference in New Issue
Block a user