Files
Cultivation/src/ui/components/common/DownloadList.tsx
2022-07-19 20:47:11 -05:00

30 lines
729 B
TypeScript

import React from 'react'
import DownloadHandler from '../../../utils/download'
import DownloadSection from './DownloadSection'
import './DownloadList.css'
interface IProps {
downloadManager: DownloadHandler
}
export default class DownloadList extends React.Component<IProps, never> {
constructor(props: IProps) {
super(props)
}
render() {
const list = this.props.downloadManager.getDownloads().map((download) => {
return (
<DownloadSection
key={download.path}
downloadName={download.path}
downloadManager={this.props.downloadManager}
/>
)
})
return <div className="DownloadList">{list.length > 0 ? list : 'No downloads present'}</div>
}
}