You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Zeile.jsx 1.0KB

12345678910111213141516171819202122232425262728293031
  1. import * as React from 'react';
  2. import PropTypes from 'prop-types';
  3. import './Zeile.css';
  4. import Besorgung from './Besorgung';
  5. export default function Zeile({besorgung, onSelect, selectedLine})
  6. {
  7. return(
  8. <tr key = {besorgung.name}
  9. className={selectedLine === besorgung.name ? 'active' : ''}
  10. onClick={() => {onSelect(besorgung.name)}}
  11. >
  12. {Object.keys(Besorgung.properties).map(property =>{
  13. const besorgungsprop = Besorgung.properties[property];
  14. return(
  15. <td>{besorgung[property]}</td>
  16. );
  17. })}
  18. </tr>
  19. );
  20. }
  21. Zeile.propTypes = {
  22. besorgung: PropTypes.object.isRequired,
  23. onSelect: PropTypes.func,
  24. selectedLine: PropTypes.string,
  25. };