/* cfb-editor (C) 2017-present SheetJS -- http://sheetjs.com */ import React, { Component } from 'react'; import { easyComp } from 'react-easy-state'; import { Link, Redirect } from 'react-router-dom'; import { Icon } from 'react-fa'; import './MainPane.css'; import { sprintf } from 'printj'; import store from '../state'; import { format_date, fix_string, decode_msi_name } from '../utils/misc'; class ManifestView extends Component { constructor(props) { super(props); } render() { if(store.isEmpty()) return ( ); return (
Archive Name: {store.fname}
 
 
Download
Rename
Add File
Close
Entries can be renamed or deleted from the file view.
Entries can be added by dragging and dropping files from your computer.

{store.isCFB() && (
Metadata (click to show) Root Name: {store.getRootName()}
CLSID: {store.getCLSID()}

)}
File Manifest
		{"  Length     Date   Time    Name\n"}
		{" --------    ----   ----    ----\n"}
		{store.getFileList().map(([fp, fi, i]) => ( 
			{sprintf("%9lu  %s   ", store.getSizeByEntry(fi), format_date(store.getFileTime(i)))}
			{fp.replace(/.*\//g,"").charCodeAt(0) >= 0x3800 && fp.replace(/.*\//g,"").charCodeAt(0) <= 0x4840 ? (
				{(`${fix_string(fp)} (${decode_msi_name(fp.replace(/.*\//g,""))})`)}
			) : (
				{fix_string(fp)}
			)}
			{"\n"}
		 ))}
	
); } } //

{store.fname} {store.getType()}

export default easyComp(ManifestView);