mirror of
https://github.com/janishutz/fundamentals-of-webengineering.git
synced 2025-11-25 05:44:24 +00:00
35 lines
787 B
TypeScript
35 lines
787 B
TypeScript
import "../Layout.css";
|
|
import { fileInfo } from "../types";
|
|
|
|
const InfoCard = (props: {
|
|
info: fileInfo
|
|
}) => {
|
|
|
|
let noFileMessage = <div></div>
|
|
if (props.info.filename === "None")
|
|
noFileMessage = <div id="data-info-placeholder">No file selected</div>;
|
|
|
|
return (
|
|
<article>
|
|
<header>
|
|
<h2>Data infos</h2>
|
|
</header>
|
|
<div className="info">
|
|
<h4>Filename</h4>
|
|
<p>{props.info.filename}</p>
|
|
|
|
<h4>File type</h4>
|
|
<p>{props.info.filetype}</p>
|
|
|
|
<h4>File size</h4>
|
|
<p>{props.info.filesize}</p>
|
|
|
|
<h4>Number of rows</h4>
|
|
<p>{props.info.rowcount}</p>
|
|
</div>
|
|
{noFileMessage}
|
|
</article>
|
|
);
|
|
}
|
|
|
|
export default InfoCard; |