ExternalAccountRow.jsx 977 B

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