QueueRow.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import React, {useState} from "react";
  2. import Modal from "../Modal";
  3. const QueueRow = (props) => {
  4. const [showModal, setShowModal] = useState(false);
  5. let style = `bg-white border-b transition duration-300 ease-in-out hover:bg-gray-100 cursor-pointer ${props.classname}`
  6. return (
  7. <>
  8. <tr className={style} onClick={() => setShowModal(true)}>
  9. <td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{props.number}</td>
  10. <td className="text-sm text-gray-900 font-light px-6 py-4">
  11. {props.name}
  12. </td>
  13. <td className="text-sm text-gray-900 font-light px-6 py-4">
  14. {props.msg}
  15. </td>
  16. </tr>
  17. {showModal ? (
  18. <>
  19. <div className="flex justify-center items-center overflow-x-hidden overflow-y-auto fixed inset-0 z-50 outline-none focus:outline-none">
  20. <div className="relative w-auto my-6 mx-auto max-w-3xl">
  21. <Modal
  22. setShowModal = {setShowModal}
  23. name = {props.name}
  24. url = {props.url}
  25. msg = {props.msg}
  26. />
  27. </div>
  28. </div>
  29. </>
  30. ): null }
  31. </>
  32. )
  33. }
  34. export default QueueRow