Draft.jsx 923 B

123456789101112131415161718192021222324252627282930
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. export default class Draft extends React.Component {
  4. render() {
  5. return (
  6. <li className="page-list-li d-flex align-items-center">
  7. <a href={`${this.props.draft.path}#edit`} target="_blank" rel="noopener noreferrer">
  8. <button type="button" className="btn-primary p-0">
  9. <span className="icon-note"></span>
  10. </button>
  11. </a>
  12. <button type="button" className="btn-danger p-0" onClick={() => { return this.props.clearDraft(this.props.draft.path) }}>
  13. <span className="icon-trash"></span>
  14. </button>
  15. <a className="page-list-link px-3" href={this.props.draft.path}>
  16. {this.props.draft.path}
  17. </a>
  18. </li>
  19. );
  20. }
  21. }
  22. Draft.propTypes = {
  23. crowi: PropTypes.object.isRequired,
  24. draft: PropTypes.object.isRequired,
  25. clearDraft: PropTypes.func.isRequired,
  26. };