EnvVarsTable.tsx 635 B

12345678910111213141516171819202122232425262728
  1. import React, { type JSX } from 'react';
  2. type EnvVarsTableProps = {
  3. envVars: Record<string, string | number | boolean>,
  4. }
  5. export const EnvVarsTable: React.FC<EnvVarsTableProps> = (props: EnvVarsTableProps) => {
  6. const envVarRows: JSX.Element[] = [];
  7. for (const [key, value] of Object.entries(props.envVars)) {
  8. if (value != null) {
  9. envVarRows.push(
  10. <tr key={key}>
  11. <th className="col-sm-4">{key}</th>
  12. <td>{value.toString()}</td>
  13. </tr>,
  14. );
  15. }
  16. }
  17. return (
  18. <table className="table table-bordered">
  19. <tbody>
  20. {envVarRows}
  21. </tbody>
  22. </table>
  23. );
  24. };