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.

35 lines
761 B

  1. import React from 'react';
  2. import {COLOR_VERY_BAD} from "../helpers/color";
  3. import "./Misc.css";
  4. const Filter = ({bool, children}) => bool ? <>{children}</> : null;
  5. export const StateFilter = ({current, required, children}) => (
  6. <Filter bool={current === required}>{children}</Filter>
  7. );
  8. export const Warning = ({children}) => (
  9. <div className="Warning" style={{color: COLOR_VERY_BAD}}>
  10. {children}
  11. </div>
  12. );
  13. export const Info = ({children}) => (
  14. <div className="Info">
  15. {children}
  16. </div>
  17. );
  18. export const InfoTable = ({keyValuePairs}) => (
  19. <Info>
  20. <table>
  21. {keyValuePairs.map(({key, value}) => (
  22. <tr key={key}>
  23. <td>{key}:</td>
  24. <td><b>{value}</b></td>
  25. </tr>
  26. ))}
  27. </table>
  28. </Info>
  29. );