import React from 'react';

import { HandlerMap } from '@wisdom-utils/components';

const MaintenanceHost = window.location.origin;
const MaintenancePath = 'civmanage';
export default class Container extends React.Component {
  constructor(props) {
    super(props);
    this.oms = this.oms.bind(this);
    // this.keyHandlerMap = new Map([[['alt+c', 'option+c'], this.oms]]);
    this.keyHandlerMap = new Map([[['alt+c'], this.oms]]);
  }

  oms(event) {
    const omsUrl = `${MaintenanceHost}/${MaintenancePath}`;
    window.open(omsUrl, '_blank');
  }

  render() {
    return (
      <HandlerMap keyHandlerMap={this.keyHandlerMap}>
        {this.props.children}
      </HandlerMap>
    );
  }
}
