<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Fullscreen from 'react-full-screen';
import Parser from 'html-react-parser';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import { activeDashboardIdSelector } from 'controllers/pages';
import classNames from 'classnames/bind';
import { GhostButton } from 'components/buttons/ghostButton';
import { PageLayout } from 'layouts/pageLayout';
import AddWidgetIcon from './img/add-inline.svg';
import AddSharedWidgetIcon from './img/add-shared-inline.svg';
import EditIcon from './img/edit-inline.svg';
import CancelIcon from './img/cancel-inline.svg';
import FullscreenIcon from './img/full-screen-inline.svg';
import styles from './dashboardItemPage.scss';
import { WidgetsGrid } from './widgetsGrid';

const cx = classNames.bind(styles);

const messages = defineMessages({
  pageTitle: {
    id: 'DashboardPage.title',
    defaultMessage: 'All Dashboards',
  },
  addNewWidget: {
    id: 'DashboardItemPage.addNewWidget',
    defaultMessage: 'Add new widget',
  },
  addSharedWidget: {
    id: 'DashboardItemPage.addSharedWidget',
    defaultMessage: 'Add shared widget',
  },
  refreshWidget: {
    id: 'DashboardItemPage.refreshWidget',
    defaultMessage: 'Edit',
  },
  deleteWidget: {
    id: 'DashboardItemPage.deleteWidget',
    defaultMessage: 'Delete',
  },
  fullscreen: {
    id: 'DashboardItemPage.fullscreen',
    defaultMessage: 'Full screen',
  },
});

@injectIntl
@connect((state) => ({ dashboardId: activeDashboardIdSelector(state) }))
export class DashboardItemPage extends Component {
  static propTypes = {
    intl: intlShape.isRequired,
    dashboardId: PropTypes.string,
  };

  static defaultProps = {
    dashboardId: undefined,
  };

  state = {
    isFullscreen: false,
  };

  onChangeFullscreen = (isFullscreen) => {
    this.setState({ isFullscreen });
  };

  toggleFullscreen = () => {
    this.setState({ isFullscreen: !this.state.isFullscreen });
  };

  render() {
    const { formatMessage } = this.props.intl;
    return (
      <PageLayout title={formatMessage(messages.pageTitle)}>
        <div className={cx('dashboard-item')}>
          <div className={cx('buttons-container')}>
            <div className={cx('nav-left')}>
              <GhostButton icon={AddWidgetIcon}>{formatMessage(messages.addNewWidget)}</GhostButton>
              <GhostButton icon={AddSharedWidgetIcon}>
                {formatMessage(messages.addSharedWidget)}
              </GhostButton>
            </div>
            <div className={cx('nav-right')}>
              <GhostButton icon={EditIcon}>{formatMessage(messages.refreshWidget)}</GhostButton>
              <GhostButton icon={FullscreenIcon} onClick={this.toggleFullscreen}>
                {formatMessage(messages.fullscreen)}
              </GhostButton>
              <GhostButton icon={CancelIcon}>{formatMessage(messages.deleteWidget)}</GhostButton>
            </div>
          </div>
        <Fullscreen enabled={this.state.isFullscreen} onChange={this.onChangeFullscreen}>
          <WidgetsGrid
            dashboardId={this.props.dashboardId}
            isFullscreen={this.state.isFullscreen}
          />
          {this.state.isFullscreen && (
            <i className={cx('icon-close')} onClick={this.toggleFullscreen}>
              {Parser(CancelIcon)}
            </i>
          )}
        </Fullscreen>
      </div>
    );
  }
}<commit_msg>EMPRPP-33984: Fix JSX parsing error<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import Fullscreen from 'react-full-screen';
import Parser from 'html-react-parser';
import { injectIntl, defineMessages, intlShape } from 'react-intl';
import { activeDashboardIdSelector } from 'controllers/pages';
import classNames from 'classnames/bind';
import { GhostButton } from 'components/buttons/ghostButton';
import { PageLayout } from 'layouts/pageLayout';
import AddWidgetIcon from './img/add-inline.svg';
import AddSharedWidgetIcon from './img/add-shared-inline.svg';
import EditIcon from './img/edit-inline.svg';
import CancelIcon from './img/cancel-inline.svg';
import FullscreenIcon from './img/full-screen-inline.svg';
import styles from './dashboardItemPage.scss';
import { WidgetsGrid } from './widgetsGrid';

const cx = classNames.bind(styles);

const messages = defineMessages({
  pageTitle: {
    id: 'DashboardPage.title',
    defaultMessage: 'All Dashboards',
  },
  addNewWidget: {
    id: 'DashboardItemPage.addNewWidget',
    defaultMessage: 'Add new widget',
  },
  addSharedWidget: {
    id: 'DashboardItemPage.addSharedWidget',
    defaultMessage: 'Add shared widget',
  },
  refreshWidget: {
    id: 'DashboardItemPage.refreshWidget',
    defaultMessage: 'Edit',
  },
  deleteWidget: {
    id: 'DashboardItemPage.deleteWidget',
    defaultMessage: 'Delete',
  },
  fullscreen: {
    id: 'DashboardItemPage.fullscreen',
    defaultMessage: 'Full screen',
  },
});

@injectIntl
@connect((state) => ({ dashboardId: activeDashboardIdSelector(state) }))
export class DashboardItemPage extends Component {
  static propTypes = {
    intl: intlShape.isRequired,
    dashboardId: PropTypes.string,
  };

  static defaultProps = {
    dashboardId: undefined,
  };

  state = {
    isFullscreen: false,
  };

  onChangeFullscreen = (isFullscreen) => {
    this.setState({ isFullscreen });
  };

  toggleFullscreen = () => {
    this.setState({ isFullscreen: !this.state.isFullscreen });
  };

  render() {
    const { formatMessage } = this.props.intl;
    return (
      <PageLayout title={formatMessage(messages.pageTitle)}>
        <div className={cx('dashboard-item')}>
          <div className={cx('buttons-container')}>
            <div className={cx('nav-left')}>
              <GhostButton icon={AddWidgetIcon}>{formatMessage(messages.addNewWidget)}</GhostButton>
              <GhostButton icon={AddSharedWidgetIcon}>
                {formatMessage(messages.addSharedWidget)}
              </GhostButton>
            </div>
            <div className={cx('nav-right')}>
              <GhostButton icon={EditIcon}>{formatMessage(messages.refreshWidget)}</GhostButton>
              <GhostButton icon={FullscreenIcon} onClick={this.toggleFullscreen}>
                {formatMessage(messages.fullscreen)}
              </GhostButton>
              <GhostButton icon={CancelIcon}>{formatMessage(messages.deleteWidget)}</GhostButton>
            </div>
          </div>
          <Fullscreen enabled={this.state.isFullscreen} onChange={this.onChangeFullscreen}>
            <WidgetsGrid
              dashboardId={this.props.dashboardId}
              isFullscreen={this.state.isFullscreen}
            />
            {this.state.isFullscreen && (
              <i className={cx('icon-close')} onClick={this.toggleFullscreen}>
                {Parser(CancelIcon)}
              </i>
            )}
          </Fullscreen>
        </div>
      </PageLayout>
    );
  }
}
{'fraction_non_alphanumeric': 0.13481712503544088, 'fraction_numerical': 0.0007088176920895946, 'mean_word_length': 3.1894299287410925, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 58, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2650913', 'n_tokens_mistral': 2039, 'n_tokens_neox': 2054, 'n_words': 385}