ExternalAccountRow.jsx 990 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. import dateFnsFormat from 'date-fns/format';
  5. const ExternalAccountRow = (props) => {
  6. const { t, account } = props;
  7. return (
  8. <tr>
  9. <td>{ account.providerType }</td>
  10. <td>
  11. <strong>{ account.accountId }</strong>
  12. </td>
  13. <td>{dateFnsFormat(new Date(account.createdAt), 'yyyy-MM-dd')}</td>
  14. <td className="text-center">
  15. <button
  16. type="button"
  17. className="btn btn-default btn-sm btn-danger"
  18. onClick={() => props.openDisassociateModal(account)}
  19. >
  20. <i className="ti-unlink"></i>
  21. { t('Disassociate') }
  22. </button>
  23. </td>
  24. </tr>
  25. );
  26. };
  27. ExternalAccountRow.propTypes = {
  28. t: PropTypes.func.isRequired, // i18next
  29. account: PropTypes.object.isRequired,
  30. openDisassociateModal: PropTypes.func.isRequired,
  31. };
  32. export default withTranslation()(ExternalAccountRow);