diff --git a/src/components/DirectoryInformation/DirectoryInformation.js b/src/components/DirectoryInformation/DirectoryInformation.js new file mode 100644 index 0000000..64a7d93 --- /dev/null +++ b/src/components/DirectoryInformation/DirectoryInformation.js @@ -0,0 +1,36 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { TableContainer, Table, TableRow, TableCell, makeStyles } from "@material-ui/core"; + +export default function DirectoryInformation({ section }) { + + const useStyles = makeStyles(() => ({ + breakWord: { + wordBreak: "break-word", + } + })); + const classes = useStyles(); + + return ( + + + {Object.keys(section).map((key) => ( + key === "type" ? "" : + + {key} + {section[key]} + + ))} +
+
+ ); +}; + +DirectoryInformation.propTypes = { + /** The object containing directory information. */ + "section": PropTypes.object +}; + +DirectoryInformation.defaultProps = { + "section": {} +}; \ No newline at end of file diff --git a/src/components/DirectoryInformation/DirectoryInformation.md b/src/components/DirectoryInformation/DirectoryInformation.md new file mode 100644 index 0000000..2a85da0 --- /dev/null +++ b/src/components/DirectoryInformation/DirectoryInformation.md @@ -0,0 +1,31 @@ +Displays the directory information as a table. + + +```jsx +import { Paper } from "@material-ui/core"; +import DirectoryInformation from "./DirectoryInformation"; + +const example_directory_data = { + "type": "directory_information", + "Name": "Heyi Feng", + "Login": "feng293", + "Computer": "civil4147pc2.ecn", + "Location": "HAMP 4147", + "Email": "feng293@purdue.edu", + "Phone": "5039154835", + "Office": "", + "UNIX Dir": "None", + "Zero Dir": "U=\\\\myhome.itap.purdue.edu\\myhome\\%username%", + "User ECNDB": "http://eng.purdue.edu/jump/2e29495", + "Host ECNDB": "http://eng.purdue.edu/jump/2eccc3f", + "Subject": "Upgrade system and Abaqus" +}; + + + + +``` + +```jsx static + +``` \ No newline at end of file diff --git a/src/components/DirectoryInformation/index.js b/src/components/DirectoryInformation/index.js new file mode 100644 index 0000000..d67daa5 --- /dev/null +++ b/src/components/DirectoryInformation/index.js @@ -0,0 +1 @@ +export { default } from "./DirectoryInformation"; \ No newline at end of file