/* 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 (
{" 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"}
))}