import React, { Component } from 'react';



import '../exchange.css';
import './manage.css';
import axios from 'axios'


class PassItem extends Component {

  passEvent=(checked)=>{
    const { id , refresh ,page } = this.props;
    const url = `/memos/${id}/memo_hidden`;
    axios.post(url,{
      checked
    }).then((result)=>{
      if(result){
        this.props.showNotification(result.data.message);
        refresh(page);
      }
    })
  }

  render(){
    return(
      <p className="ml50">
        <span className="middle-default-btn small-blue-btn c_point" onClick={()=>this.passEvent(true)}>通过</span>
        <span className="middle-default-btn ml20 c_point" onClick={()=>this.passEvent(false)}>不通过</span>
      </p>
    )
  }
}

export default PassItem;