{"size": 1282, "ext": "js", "max_stars_repo_path": "src/views/mobile/Profile/ProfileCredit.js", "max_stars_repo_name": "masterappIT/mms_Backend_new", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/views/mobile/Profile/ProfileCredit.js", "max_issues_repo_name": "masterappIT/mms_Backend_new", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/views/mobile/Profile/ProfileCredit.js", "max_forks_repo_name": "masterappIT/mms_Backend_new", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.4888888889, "max_line_length": 99, "alphanum_fraction": 0.5663026521}
import React, { useState, useEffect } from "react";
import { Link, useParams } from "react-router-dom";

// components
import PreviousPageBlue from "../../../components-m/Utility/previous-page-blue.js";
import BurgerMenuBule from "../../../components-m/Utility/previous-page-BurgerMenu-bule.js";
import Credit from "../../../components-m/Profile/credit.js";

export default function Index() {
  const [credit, setCredit] = useState([]);
  const { company } = useParams();

  useEffect(() => {
    var result = [];
    for (var i = 0; i < 2; i++) {
      result.push(<Credit />);
    }
    setCredit(result);

    // scroll to top
    window.scrollTo(0, 0);
  }, []);

  return (
    <>
      <div className="main2 min-h-screen">
        <div className="top3 w-full grid grid-cols-3 flex items-center px-5">
          <div className="flex items-center">
            <BurgerMenuBule />
            <PreviousPageBlue />
          </div>
          <h4 className="text-center">信用卡</h4>
          <Link
            to={`/${company}/mobile/profile/credit/add`}
            className="add-credit py-3 px-5 text-white ml-auto hover:no-underline hover:text-white"
          >
            新增
          </Link>
        </div>
        <div class="m-3">{credit}</div>
      </div>
    </>
  );
}
