TableRows.jsx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // ./src/stories/TableRows.js
  2. import React from 'react';
  3. import {QueueRow} from "./QueueRow";
  4. /**
  5. * A list of queues.
  6. *
  7. * @param rows
  8. * @returns {JSX.Element}
  9. * @constructor
  10. */
  11. const TableRows = ({rows = []}) => {
  12. return (
  13. <>
  14. {rows === [] ? <p>Empty</p> : (
  15. <table className="min-w-full">
  16. <thead className="bg-gray-200 border-b">
  17. <tr>
  18. <th scope="col" className="text-sm font-medium text-gray-900 px-6 py-4 text-left">
  19. #
  20. </th>
  21. <th scope="col" className="text-sm font-medium text-gray-900 px-6 py-4 text-left">
  22. Nom
  23. </th>
  24. <th scope="col" className="text-sm font-medium text-gray-900 px-6 py-4 text-left">
  25. ARN
  26. </th>
  27. <th scope="col" className="text-sm font-medium text-gray-900 px-6 py-4 text-left">
  28. Messages
  29. </th>
  30. <th></th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. {rows.map((row, index) => {
  35. return <QueueRow key={index}
  36. index={index + 1}
  37. arn={row.props.arn}
  38. itemCount={row.props.itemCount}
  39. qName={row.props.qName}
  40. url={row.props.url}/>
  41. })}
  42. </tbody>
  43. <React.StrictMode/>
  44. </table>
  45. )}
  46. </>
  47. );
  48. }
  49. export {
  50. TableRows,
  51. }