From e13e630cd6e4fc0b1ff92098a28a770794c7bb9a Mon Sep 17 00:00:00 2001 From: gabrhr <73925454+gabrhr@users.noreply.github.com> Date: Wed, 20 Apr 2022 10:19:29 -0500 Subject: =?UTF-8?q?A=C3=B1adir=20plantilla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Base para front --- .../app/components/Widget/TableWidget.js | 124 +++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 front/odiparpack/app/components/Widget/TableWidget.js (limited to 'front/odiparpack/app/components/Widget/TableWidget.js') diff --git a/front/odiparpack/app/components/Widget/TableWidget.js b/front/odiparpack/app/components/Widget/TableWidget.js new file mode 100644 index 0000000..47bb7ba --- /dev/null +++ b/front/odiparpack/app/components/Widget/TableWidget.js @@ -0,0 +1,124 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { withStyles } from '@material-ui/core/styles'; +import classNames from 'classnames'; +import messageStyles from 'ba-styles/Messages.scss'; +import progressStyles from 'ba-styles/Progress.scss'; +import avatarApi from 'ba-api/avatars'; +import { + Typography, + Table, + TableBody, + TableCell, + TableHead, + TableRow, + Chip, + LinearProgress, + Avatar, + Icon, +} from '@material-ui/core'; +import PapperBlock from '../PapperBlock/PapperBlock'; +import styles from './widget-jss'; + + +let id = 0; +function createData(name, avatar, title, type, taskNumber, taskTitle, progress, status) { + id += 1; + return { + id, + name, + avatar, + title, + type, + taskNumber, + taskTitle, + progress, + status, + }; +} + +const data = [ + createData('John Doe', avatarApi[6], 'Front End Developer', 'bug_report', 2214, 'Vivamus sit amet interdum elit', 30, 'Error'), + createData('Jim Doe', avatarApi[8], 'System Analyst', 'flag', 2455, 'Nam sollicitudin dignissim nunc', 70, 'Success'), + createData('Jane Doe', avatarApi[2], 'Back End Developer', 'whatshot', 3450, 'Quisque ut metus sit amet augue rutrum', 50, 'Warning'), + createData('Jack Doe', avatarApi[9], 'CTO', 'settings', 4905, 'Cras convallis lacus orci', 85, 'Info'), + createData('Jessica Doe', avatarApi[5], 'Project Manager', 'book', 4118, 'Aenean sit amet magna vel magna', 33, 'Default'), +]; + +function TableWidget(props) { + const { classes } = props; + const getStatus = status => { + switch (status) { + case 'Error': return messageStyles.bgError; + case 'Warning': return messageStyles.bgWarning; + case 'Info': return messageStyles.bgInfo; + case 'Success': return messageStyles.bgSuccess; + default: return messageStyles.bgDefault; + } + }; + const getProgress = status => { + switch (status) { + case 'Error': return progressStyles.bgError; + case 'Warning': return progressStyles.bgWarning; + case 'Info': return progressStyles.bgInfo; + case 'Success': return progressStyles.bgSuccess; + default: return progressStyles.bgDefault; + } + }; + const getType = type => { + switch (type) { + case 'bug_report': return classes.red; + case 'flag': return classes.indigo; + case 'whatshot': return classes.orange; + case 'settings': return classes.lime; + default: return classes.purple; + } + }; + return ( + +
+ + + + Name + Task + + + + {data.map(n => ([ + + +
+ +
+ {n.name} + {n.title} +
+
+
+ +
+ {n.type} + + # + {n.taskNumber} + + +
+ +
+
+ ]) + )} +
+
+
+
+ ); +} + +TableWidget.propTypes = { + classes: PropTypes.object.isRequired, +}; + +export default withStyles(styles)(TableWidget); -- cgit v1.2.3