import React from 'react'; import Disk from '../icons/Disk'; import DirectoryTree from '../filesystem/DirectoryTree'; import File from '../icons/File'; export default class TorrentFiles extends React.Component { constructDirectoryTree(tree = {}, directory, file, depth = 0) { if (depth < file.pathComponents.length - 1) { depth++; tree[directory] = this.constructDirectoryTree( tree[directory], file.pathComponents[depth], file, depth ); } else { if (!tree.files) { tree.files = []; } tree.files.push(file); } return tree; } getFileData(torrent) { return (