All files / client/components/Admin/User InvitedUserModal.tsx

0% Statements 0/3
0% Branches 0/2
0% Functions 0/2
0% Lines 0/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44                                                                                       
import React, { FC } from 'react'
import { Modal, ModalHeader, ModalBody, Table } from 'reactstrap'
 
interface Props {
  users: any[]
  clear: () => void
}
 
const InvitedUserModal: FC<Props> = ({ users, clear }) => {
  return (
    <Modal isOpen={users.length > 0} toggle={clear}>
      <ModalHeader toggle={clear}>ユーザーを招待しました</ModalHeader>
      <ModalBody>
        <p>
          作成したユーザーは仮パスワードが設定されています。
          <br />
          仮パスワードはこの画面を閉じると二度と表示できませんのでご注意ください。
          <span className="text-danger">招待メールを送っていない場合、この画面で必ず仮パスワードをコピーし、招待者へ連絡してください。</span>
        </p>
        <Table>
          <thead>
            <tr>
              <th>メールアドレス</th>
              <th>パスワード</th>
            </tr>
          </thead>
          <tbody>
            {users.map(({ user, email, password }) => (
              <tr key={email}>
                <td>
                  <pre>{email}</pre>
                </td>
                <td>{user ? <pre>{password}</pre> : <span className="text-danger">作成失敗</span>}</td>
              </tr>
            ))}
          </tbody>
        </Table>
      </ModalBody>
    </Modal>
  )
}
 
export default InvitedUserModal