Guest User

Untitled

a guest
Feb 22nd, 2023
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export default function UserCard(props: Common.User, key: React.Key) {
  2.   const [show, setShow] = useState(false);
  3.   return (
  4.     <>
  5.       <div className="user" key={key} onClick={() => setShow(true)}>
  6.         <Text>
  7.           {props.firstName} {props.lastName}
  8.         </Text>
  9.         <Text>{props.email}</Text>
  10.         <Text>{props.role}</Text>
  11.         <Text>{props.plan}</Text>
  12.       </div>
  13.       {show && (
  14.         <Modal setIsOpen={setShow}>
  15.           <div className="user-modal flex-c">
  16.             <Text fs-22 pb16>
  17.               {props.firstName} {props.lastName}
  18.             </Text>
  19.             <Text fs-16 pb10>
  20.               Email: {props.email}
  21.             </Text>
  22.             <Text fs-16 pb10>
  23.               Plane: {props.plan}
  24.             </Text>
  25.             <Text fs-16 pb10>
  26.               Role:{" "}
  27.               <select name="role" defaultValue={props.role}>
  28.                 <option value="admin">Admin</option>
  29.                 <option value="mod">Moderator</option>
  30.                 <option value="user">User</option>
  31.               </select>
  32.             </Text>
  33.             <button
  34.               className="bgc2 pl16 pr16 pt4 pb4 no-border fs-20 cw br-40"
  35.               onClick={() => setShow(false)}
  36.             >
  37.               Update
  38.             </button>
  39.           </div>
  40.         </Modal>
  41.       )}
  42.     </>
  43.   );
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment