import React from "react";
import Title from "../../component/Title.jsx";
import Table from "../../component/Table.jsx";
import Map from "../../component/chart/Map.jsx";
import Chart from "../../component/chart/Chart.jsx";
import Chart5_agency from "../../component/chart/Chart5_agency.jsx";
import Chart2_agency from "../../component/chart/Chart2_agency.jsx";
import AddCircleIcon from "@mui/icons-material/AddCircle";
import Calendar_agency from "../../component/Calendar_agency.jsx";
import tool from "../../../resources/files/images/tool.png";
import medicinebox from "../../../resources/files/images/medicinebox.png";
import box from "../../../resources/files/images/box.png";
import exchange from "../../../resources/files/images/exchange.png";
import error from "../../../resources/files/images/error.png";
import batteryAgency from "../../../resources/files/images/batteryAgency.png";
import medicineAgency from "../../../resources/files/images/medicineAgency.png";
import temperatureAgency from "../../../resources/files/images/temperatureAgency.png";
import TitleSmall from "../../component/TitleSmall.jsx";

export default function Main2() {
  const data = [
    {
      id: 1,
      title: "교환/수리 리스트",
    },
    {
      id: 2,
      title: "장비 추가 리스트",
    },
  ]
  const [index, setIndex] = React.useState(1);
  const thead = ["No", "이름", "대상자등록번호", "생년월일", "연락처", "주소", "미복약 누적 횟수",];
  const key = ["No", "name", "number", "birth", "phone", "address", "average"];
  const content = [
    {
      No: 1,
      name: "김복남",
      number: "00000001",
      birth: "1948.11.15",
      phone: "010-1234-5678",
      address: "경상북도 군위군 삼국유사면",
      average: "6회",
    },
  ];


  return (
    <main>
      <div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"대상자 현황"} explanation={"2023.02.28 기준"} /></div>
      <div className="main-grid-agency margin-bottom2">
        <ul className="content-box statistics-agency" background="#f7acba">
          <li className="flex-start">
            <img src={box} alt="" />
            <div className="text">
              <p>나의 관리 대상자</p>
              <p>40</p>
            </div>
          </li>
        </ul>
        <ul className="content-box statistics-agency" background="#8ef3d1">
          <li className="flex-start">
            <img src={medicineAgency} alt="" />
            <div className="text">
              <p>미복약 위험 대상자</p>
              <p>40</p>
            </div>
          </li>
        </ul>
        <ul className="content-box statistics-agency" background="#ebe7b9" >
          <li className="flex-start">
            <img src={temperatureAgency} alt="" />
            <div className="text">
              <p>댁내 온도 위험 대상자</p>
              <p>40</p>
            </div>
          </li>
        </ul>
        <ul className="content-box statistics-agency" background="#5f9af3">
          <li className="flex-start">
            <img src={batteryAgency} alt="" />
            <div className="text">
              <p>배터리 부족 대상자 </p>
              <p>40</p>
            </div>
          </li>
        </ul>
      </div>
      <div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"장비 관리 리스트"}  /></div>
      <div className="main-grid-agency">
        <div className="content-box combine-left-government3">
          <ul className="tab-menu-agency flex-start">
            {data.map((item) => (
              <li
                key={item.id}
                className={index === item.id ? "active" : null}
                onClick={() => setIndex(item.id)}
              >
                {item.title}
              </li>
            ))}
          </ul>
          <div className="content-wrap equipmentlist">
            <div className="margin-bottom2">
              <Calendar_agency />
            </div>
            <ul className="tab-content">
              {data
                .filter((item) => index === item.id)
                .map((item) => (
                  <li>{item.description}</li>
                ))}
            </ul>
          </div>
        </div>
      </div>
    </main>
  );
}
