<commit_before>import React, { useState } from 'react';
import ClientTabSelector from './ClientTabSelector';
import ClientGeneralInfo from './ClientGeneralInfo';
import ClientOverview from './ClientOverview';
import ClientTab from './ClientTab';

function ClientLayout(props) {
  const { client, permissions, eligibleClient } = props;
  const {
    showReferralStatus,
    showEnrollments,
    updateEnrollment,
    annualEnrollment,
    exitEnrollment,
    isSkidrowApp,
    showEditButton,
  } = permissions;

  const tabsList = [
    { id: 'overview', enabled: true, title: 'Overview' },
    { id: 'eligibility', enabled: true, title: 'History' },
    { id: 'rois', enabled: true, title: 'ROIs' },
    { id: 'referrals', enabled: showReferralStatus, title: 'Referrals' },
    { id: 'enrollments', enabled: showEnrollments, title: 'Enrollments' },
    { id: 'create-enrollment', enabled: showEnrollments, title: 'Create Enrollment' },
    { id: 'update-enrollment', enabled:
      showEnrollments && updateEnrollment, title: 'Update Enrollment' },
    { id: 'annual-enrollment', enabled:
      showEnrollments && annualEnrollment, title: 'Annual Enrollment' },
    { id: 'exit-enrollment', enabled:
      showEnrollments && exitEnrollment, title: 'Exit Enrollment' },
    { id: 'client-tags', enabled: !isSkidrowApp, title: 'Tags' },
    { id: 'services', enabled: !isSkidrowApp, title: 'Services' },
    // { id: 'case-management', enabled: false, title: 'Case Management' },
    // { id: 'responses', enabled: false, title: 'Responses' },
  ].filter((t) => t.enabled);

  const [selectedTab, selectTab] = useState(props.selectedTab || tabsList[0].id);

  console.log('selectedTab', selectedTab);

  return (
    <div id="viewClient_content" className="col-xs-12">
      {eligibleClient && eligibleClient.ignoreMatchProcess &&
        <div className="col-xs-12">
          <div className="alert alert-danger">
            Client has been Removed from Matching
          </div>
        </div>
      }
      <div className="row client-profile-container">
        <ClientGeneralInfo client={client} />

        <div className="tab-section">
          <ClientTabSelector tabs={tabsList} tab={selectedTab} selectTab={selectTab} />

          <div className="tab-content card">
            <ClientTab selectedTab={selectedTab} id={'overview'} >
              <ClientOverview client={client} permissions={{ showEditButton }} />
            </ClientTab>
          </div>
        </div>
      </div>
    </div>
  );
}

export default ClientLayout;
<commit_msg>Introduce recent master changes to client page<commit_after>import React, { useState } from 'react';
import ClientTabSelector from './ClientTabSelector';
import ClientGeneralInfo from './ClientGeneralInfo';
import ClientOverview from './ClientOverview';
import ClientTab from './ClientTab';

function ClientLayout(props) {
  const { client, permissions, eligibleClient } = props;
  const {
    showReferralStatus,
    showEnrollments,
    updateEnrollment,
    annualEnrollment,
    exitEnrollment,
    isSkidrowApp,
    showEditButton,
  } = permissions;

  const tabsList = [
    { id: 'overview', enabled: true, title: 'Overview' },
    { id: 'eligibility', enabled: true, title: 'History' },
    { id: 'rois', enabled: !isSkidrowApp, title: 'ROIs' },
    { id: 'referrals', enabled: showReferralStatus, title: 'Referrals' },
    { id: 'enrollments', enabled: showEnrollments, title: 'Enrollments' },
    { id: 'create-enrollment', enabled: showEnrollments, title: 'Create Enrollment' },
    { id: 'update-enrollment', enabled:
      showEnrollments && updateEnrollment, title: 'Update Enrollment' },
    { id: 'annual-enrollment', enabled:
      showEnrollments && annualEnrollment, title: 'Annual Enrollment' },
    { id: 'exit-enrollment', enabled:
      showEnrollments && exitEnrollment, title: 'Exit Enrollment' },
    { id: 'client-tags', enabled: !isSkidrowApp, title: 'Tags' },
    { id: 'services', enabled: !isSkidrowApp, title: 'Services' },
    // { id: 'case-management', enabled: false, title: 'Case Management' },
    // { id: 'responses', enabled: false, title: 'Responses' },
  ].filter((t) => t.enabled);

  const [selectedTab, selectTab] = useState(props.selectedTab || tabsList[0].id);

  console.log('selectedTab', selectedTab);

  return (
    <div id="viewClient_content" className="col-xs-12">
      {eligibleClient && eligibleClient.ignoreMatchProcess &&
        <div className="col-xs-12">
          <div className="alert alert-danger">
            Client has been Removed from Matching
          </div>
        </div>
      }
      <div className="row client-profile-container">
        <ClientGeneralInfo client={client} />

        <div className="tab-section">
          <ClientTabSelector tabs={tabsList} tab={selectedTab} selectTab={selectTab} />

          <div className="tab-content card">
            <ClientTab selectedTab={selectedTab} id={'overview'} >
              <ClientOverview client={client} permissions={{ showEditButton }} />
            </ClientTab>
          </div>
        </div>
      </div>
    </div>
  );
}

export default ClientLayout;

{'fraction_non_alphanumeric': 0.14349514563106797, 'fraction_numerical': 0.001941747572815534, 'mean_word_length': 3.4366925064599485, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, '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': '2130271', 'n_tokens_mistral': 1534, 'n_tokens_neox': 1521, 'n_words': 370}