{"size": 1873, "ext": "js", "max_stars_repo_path": "packages/admin-legacy/src/containers/pages/InnmDetailPage/index.js", "max_stars_repo_name": "ehealth-ua/ehealth.web", "max_stars_repo_stars_event_min_datetime": "2019-06-26T12:48:22.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-11T09:20:56.000Z", "max_issues_repo_path": "packages/admin-legacy/src/containers/pages/InnmDetailPage/index.js", "max_issues_repo_name": "ehealth-ua/ehealth.web", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/admin-legacy/src/containers/pages/InnmDetailPage/index.js", "max_forks_repo_name": "ehealth-ua/ehealth.web", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.1449275362, "max_line_length": 76, "alphanum_fraction": 0.561131874}
import React from "react";
import { compose } from "redux";
import { connect } from "react-redux";
import { provideHooks } from "redial";

import Helmet from "react-helmet";

import { H1 } from "../../../components/Title";
import InnmForm from "../../forms/InnmForm";
import { withRouter } from "react-router";
import BackLink from "../../blocks/BackLink";
import Line from "../../../components/Line";
import Button from "../../../components/Button";
import { FormRow, FormColumn } from "../../../components/Form";

import { getInnm } from "../../../reducers";
// import { deactivateInnms } from 'redux/innms';
import { fetchInnm } from "./redux";

import { BackIcon } from "@ehealth/icons";

class InnmDetailPage extends React.Component {
  render() {
    const { innm = {} } = this.props;

    return (
      <div id="innm-detail-page">
        <Helmet
          title="Сторінка делатей МНН"
          meta={[{ property: "og:title", content: "Сторінка делатей МНН" }]}
        />
        <BackLink onClick={() => this.props.router.push("/innms")}>
          Повернутися до списку МНН
        </BackLink>
        <Line />

        <H1>Сторінка делатей МНН</H1>

        <InnmForm initialValues={innm} disabled />

        <FormRow>
          <FormColumn>
            <Button
              onClick={() => this.props.router.push("/medications")}
              theme="border"
              color="blue"
              icon={<BackIcon width="20" height="12" />}
              block
            >
              Повернутися до списку
            </Button>
          </FormColumn>
          <FormColumn />
        </FormRow>
      </div>
    );
  }
}

export default compose(
  withRouter,
  provideHooks({
    fetch: ({ dispatch, params: { id } }) => dispatch(fetchInnm(id))
  }),
  connect((state, { params: { id } }) => ({
    innm: getInnm(state, id)
  }))
)(InnmDetailPage);
