aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pages/provider-approval/provider-approval.component.js
blob: 67e8bdd4c4ee76d1a579b23b99294d1d530c0127 (plain) (blame)
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
import PageContainerContent from '../../page-container'
import PropTypes from 'prop-types'
import React, { Component } from 'react'

export default class ProviderApproval extends Component {
  static propTypes = {
    approveProviderRequest: PropTypes.func,
    origin: PropTypes.string,
    rejectProviderRequest: PropTypes.func,
  };

  static contextTypes = {
    t: PropTypes.func,
  };

  render () {
    const { approveProviderRequest, origin, rejectProviderRequest } = this.props
    return (
      <PageContainerContent
        title={this.context.t('providerAPIRequest')}
        subtitle={this.context.t('reviewProviderRequest')}
        contentComponent={(
          <div className="provider_approval_content">
            {this.context.t('providerRequestInfo')}
            <div className="provider_approval_origin">{origin}</div>
          </div>
        )}
        submitText={this.context.t('approve')}
        cancelText={this.context.t('reject')}
        onSubmit={() => { approveProviderRequest(origin) }}
        onCancel={() => { rejectProviderRequest(origin) }}
        onClose={() => { rejectProviderRequest(origin) }} />
    )
  }
}