/**
 * @author : 최정우
 * @since : 2022.09.20
 * @dscription : Application의 Route 정보를 관리하는 Component 입니다.
 */
import React from "react";
//react router 라이브러리 import
import { Routes, Route } from "react-router-dom";

import HouseIcon from "@mui/icons-material/House";
import PersonIcon from "@mui/icons-material/Person";
import Diversity1Icon from "@mui/icons-material/Diversity1";
import SpeakerPhoneIcon from "@mui/icons-material/SpeakerPhone";
import SettingsIcon from "@mui/icons-material/Settings";
import ConstructionIcon from '@mui/icons-material/Construction';
import EqualizerIcon from '@mui/icons-material/Equalizer';
import ApartmentIcon from '@mui/icons-material/Apartment';
import LocalHospitalIcon from '@mui/icons-material/LocalHospital';

import Test from "./Test/Test.jsx";
import Main_government from "./main/Main_government.jsx";
import Main_guardian from "./main/Main_guardian.jsx";
import Main_agency from "./main/Main_agency.jsx";
import Main from "./main/Main.jsx";
import SeniorInsert from "./senior_management/SeniorInsert.jsx";
import SeniorSelectOne from "./senior_management/SeniorSelectOne.jsx";
import MedicineCareSelectOne from "./healthcare/medicinecare/MedicineCareSelectOne.jsx";
import TemperatureManagementSelectOne from "./healthcare/temperature/TemperatureManagementSelectOne.jsx";
import MedicineStatistics from "./healthcare/statistics/MedicineStatistics.jsx";
import GuardianStatistics from "./healthcare/statistics/GuardianStatistics.jsx";
import VisitInsert from "./visit/visit/VisitInsert.jsx";
import VisitSelectOne from "./visit/visit/VisitSelectOne.jsx";
import EquipmentRentalInsert from "./equipment/EquipmentRentalInsert.jsx";
import EquipmentManagementSelect from "./equipment/EquipmentManagementSelect.jsx";
import EquipmentManagementSelectOne from "./equipment/EquipmentManagementSelectOne.jsx";
import UserAuthoriySelect from "./user_management/UserAuthoriySelect.jsx";
import UserAuthoriySelect_agency from "./user_management/UserAuthoriySelect_agency.jsx";
import QandASelect from "./callcenter/QandASelect.jsx";
import QandAConfirm from "./callcenter/QandAConfirm.jsx";
import EquipmentManagementInsert from "./equipment/EquipmentManagementInsert.jsx";
import EquipmentManagementSelectAdd from "./equipment/EquipmentManagementSelectAdd.jsx";
import RiskSet from "./setting/RiskSet.jsx";
import QandAInsert from "./callcenter/QandAInsert.jsx";
import QuestionInsert from "./callcenter/QuestionInsert.jsx";
import QuestionConfirm from "./callcenter/QuestionConfirm.jsx";
import UserSelectOk from "./user_management/UserSelectOk.jsx";
import AuthorityManagement from "./setting/AuthorityManagement.jsx";
import AgencyInsert from "./user_management/AgencyInsert.jsx";
import AgencySelect from "./user_management/AgencySelect.jsx";
import ProtectorSelect from "./user_management/ProtectorSelect.jsx";
import QuestionSelect from "./callcenter/QuestionSelect.jsx";
import Join from "./join/Join.jsx";
import Healthcare from "./healthcare/Healthcare.jsx"
import Medicalcare from "./healthcare/Medicalcare.jsx"

const AllAppMenuItems = [
  {
    title: "올잇메디",
    path: "/Main",
    childrens: [
      {
        title: "Home",
        path: "/Main",
        icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />,
      },
      {
        title: "사용자 관리",
        path: "/UserAuthoriySelect",
        icon: (
          <PersonIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
      },
      {
        title: "건강관리",
        path: "/Healthcare",
        icon: (
          <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
      },
      {
        title: "진료 관리",
        path:"/Medicalcare",
        icon: (
          <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
      },
      {
        title: "장비 관리",
        icon: (
          <ConstructionIcon
            sx={{ fontSize: 20, color: "#333333", marginRight: 1 }}
          />
        ),
        childrens: [
          {
            title: "장비 조회",
            path: "/EquipmentManagementSelect",
          },
          {
            title: "장비 문의 관리",
            path: "/QandASelect",
          },
        ],
      },
    ],
  },
  {
    title: "관리기관",
    path: "/Main_government",
    childrens: [
      {
        title: "Home",
        path: "/Main_government",
        icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />,
      },
      {
        title: "기관 관리",
        icon: (
          <ApartmentIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
        childrens: [
          {
            title: "기관 조회",
            path: "/AgencySelect",
          },
          {
            title: "사용자 계정 승인",
            path: "/UserSelectOk",
          },
        ],
      },
      {
        title: "건강 관리",
        path: "/Healthcare",
        icon: (
          <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
      },
      {
        title: "진료 관리",
        path:"/Medicalcare",
        icon: (
          <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
      },
      {
        title: "문의 현황 관리",
        path: "/QandASelect",
        icon: (
          <SpeakerPhoneIcon
            sx={{ fontSize: 20, color: "#333333", marginRight: 1 }}
          />
        ),
      },
      {
        title: "설정 관리",
        icon: (
          <SettingsIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
        childrens: [
          {
            title: "위험 기준 관리",
            path: "/RiskSet",
          },
          {
            title: "사용자 권한 관리",
            path: "/AuthorityManagement",
          },
        ],
      },
    ],
  },
  {
    title: "시행기관",
    path: "/Main_agency",
    childrens: [
      {
        title: "Home",
        path: "/Main_agency",
        icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />,
      },
      {
        title: "대상자 관리",
        path: "/UserAuthoriySelect_agency",
        icon: (
          <PersonIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
      },
      {
        title: "건강 관리",
        path:"/Healthcare",
        icon: (
          <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
      },
      {
        title: "진료 관리",
        path:"/Medicalcare",
        icon: (
          <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
      },
      {
        title: "장비 관리",
        icon: (
          <ConstructionIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
        ),
        childrens: [
          {
            title: "장비 대여 관리",
            path: "/EquipmentManagementSelect",
          },
          {
            title: "문의게시판",
            path: "/QandASelect",
          },
        ]
      },
      {
        title: "Q&A",
        path: "/QuestionSelect",
        icon: (
          <SpeakerPhoneIcon
            sx={{ fontSize: 20, color: "#333333", marginRight: 1 }}
          />
        ),
      },
    ],
  },
  {
    title: "보호자",
    childrens: [
      {
        title: "Home",
        path: "/Main_guardian",
        icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />,
      },
      {
        title: "그래프로 보기",
        path: "/GuardianStatistics",
        icon: <EqualizerIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />,
      },
      {
        title: "Q&A",
        path: "/QuestionSelect",
        icon: (
          <SpeakerPhoneIcon
            sx={{ fontSize: 20, color: "#333333", marginRight: 1 }}
          />
        ),
      },
    ],
  },
];

function AllAppRoute() {
  return (
    <Routes>
      <Route path="/Medicalcare" element={<Medicalcare />}></Route>
      <Route path="/Healthcare" element={<Healthcare />}></Route>
      <Route path="/QuestionConfirm" element={<QuestionConfirm />}></Route>
      <Route path="/QuestionInsert" element={<QuestionInsert />}></Route>
      <Route path="/GuardianStatistics" element={<GuardianStatistics />}></Route>
      <Route path="/Main_guardian" element={<Main_guardian />}></Route>
      <Route path="/QuestionSelect" element={<QuestionSelect />}></Route>
      <Route path="/Join" element={<Join />}></Route>
      <Route path="/QuestionSelect" element={<QuestionSelect />}></Route>
      <Route path="/Main_agency" element={<Main_agency />}></Route>
      <Route path="/UserAuthoriySelect_agency" element={<UserAuthoriySelect_agency />}></Route>
      <Route path="/SeniorInsert" element={<SeniorInsert />}></Route>
      <Route path="/SeniorSelectOne" element={<SeniorSelectOne />}></Route>      
      <Route
        path="/MedicineCareSelectOne"
        element={<MedicineCareSelectOne />}
      ></Route>
      <Route
        path="/TemperatureManagementSelectOne"
        element={<TemperatureManagementSelectOne />}
      ></Route>
      <Route path="/VisitInsert" element={<VisitInsert />}></Route>
      <Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route>
      <Route
        path="/EquipmentRentalInsert"
        element={<EquipmentRentalInsert />}
      ></Route>
      <Route
        path="/EquipmentManagementSelect"
        element={<EquipmentManagementSelect />}
      ></Route>
      <Route
        path="/EquipmentManagementSelectOne"
        element={<EquipmentManagementSelectOne />}
      ></Route>
      <Route
        path="/QandASelect"
        element={<QandASelect />}
      ></Route>
      <Route
        path="/QandAInsert"
        element={<QandAInsert />}
      ></Route>
      <Route
        path="/QandAConfirm"
        element={<QandAConfirm />}
      ></Route>
      <Route path="/Main_government" element={<Main_government />}></Route>
      <Route path="/AgencySelect" element={<AgencySelect />}></Route>
      <Route path="/UserSelectOk" element={<UserSelectOk />}></Route>
      <Route
        path="/MedicineCareSelectOne"
        element={<MedicineCareSelectOne />}
      ></Route>
      <Route
        path="/TemperatureManagementSelectOne"
        element={<TemperatureManagementSelectOne />}
      ></Route>
      <Route
        path="/MedicineStatistics"
        element={<MedicineStatistics />}
      ></Route>
      <Route path="/VisitInsert" element={<VisitInsert />}></Route>
      <Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route>
      <Route
        path="/UserAuthoriySelect"
        element={<UserAuthoriySelect />}
      ></Route>
      <Route path="/RiskSet" element={<RiskSet />}></Route>
      <Route path="/AuthorityManagement" element={<AuthorityManagement />}></Route>
      <Route path="/QandASelect" element={<QandASelect />}></Route>
      <Route path="/QandAConfirm" element={<QandAConfirm />}></Route>
      <Route path="/QandAInsert" element={<QandAInsert />}></Route>
      <Route path="/ProtectorSelect" element={<ProtectorSelect />}></Route>
      <Route path="/SeniorInsert" element={<SeniorInsert />}></Route>
      <Route path="/AgencyInsert" element={<AgencyInsert />}></Route>
      <Route path="/Join" element={<Join />}></Route>
      <Route path="/Test" element={<Test />}></Route>
      <Route path="/Main" element={<Main />}></Route>
      <Route
        path="/EquipmentRentalInsert"
        element={<EquipmentRentalInsert />}
      ></Route>
      <Route
        path="/EquipmentManagementInsert"
        element={<EquipmentManagementInsert />}
      ></Route>
      <Route
        path="/EquipmentManagementSelect"
        element={<EquipmentManagementSelect />}
      ></Route>
      <Route
        path="/EquipmentManagementSelectOne"
        element={<EquipmentManagementSelectOne />}
      ></Route>
      <Route
        path="/MedicineCareSelectOne"
        element={<MedicineCareSelectOne />}
      ></Route>
      <Route
        path="/TemperatureManagementSelectOne"
        element={<TemperatureManagementSelectOne />}
      ></Route>      
      <Route
        path="/VisitSelectOne"
        element={<VisitSelectOne />}
      ></Route>
      <Route path="/QandAInsert" element={<QandAInsert />}></Route>
      <Route path="/QandASelect" element={<QandASelect />}></Route>
      <Route path="/EquipmentManagementSelectAdd" element={<EquipmentManagementSelectAdd />}></Route>
      <Route path="/UserAuthoriySelect" element={<UserAuthoriySelect />}></Route>
      <Route path="/QandAConfirm" element={<QandAConfirm />}></Route>
    </Routes>
  );
}



const AdminAppMenuItems = [
  {
    title: "Home",
    path: "/Main",
    icon: <HouseIcon sx={{ fontSize: 20, marginRight: 1 }} />,
  },
  {
    title: "사용자 관리",
    path: "/UserAuthoriySelect",
    icon: (
      <PersonIcon sx={{ fontSize: 20, marginRight: 1 }} />
    ),
  },
  {
    title: "건강 관리",
    path:"/Healthcare",
    icon: (
      <Diversity1Icon sx={{ fontSize: 20, marginRight: 1 }} />
    ),
  },
  {
    title: "진료 관리",
    path:"/Medicalcare",
    icon: (
      <LocalHospitalIcon sx={{ fontSize: 20, marginRight: 1 }} />
    ),
  },
  {
    title: "장비 관리",
    icon: (
      <ConstructionIcon
        sx={{ fontSize: 20, marginRight: 1 }}
      />
    ),
    childrens: [
      {
        title: "장비 조회",
        path: "/EquipmentManagementSelect",
      },
      {
        title: "장비 문의 관리",
        path: "/QandASelect",
      },
    ],
  },

];
function AdminAppRoute() {
  return (
    <Routes>
      <Route path="/Medicalcare" element={<Medicalcare />}></Route>
      <Route path="/Healthcare" element={<Healthcare />}></Route>
      <Route path="/Test" element={<Test />}></Route>
      <Route path="/Main" element={<Main />}></Route>
      <Route
        path="/EquipmentRentalInsert"
        element={<EquipmentRentalInsert />}
      ></Route>
      <Route
        path="/EquipmentManagementInsert"
        element={<EquipmentManagementInsert />}
      ></Route>
      <Route
        path="/EquipmentManagementSelect"
        element={<EquipmentManagementSelect />}
      ></Route>
      <Route
        path="/EquipmentManagementSelectOne"
        element={<EquipmentManagementSelectOne />}
      ></Route>
      <Route
        path="/MedicineCareSelectOne"
        element={<MedicineCareSelectOne />}
      ></Route>
      <Route
        path="/TemperatureManagementSelectOne"
        element={<TemperatureManagementSelectOne />}
      ></Route>      
      <Route
        path="/VisitSelectOne"
        element={<VisitSelectOne />}
      ></Route>
      <Route path="/QandAInsert" element={<QandAInsert />}></Route>
      <Route path="/QandASelect" element={<QandASelect />}></Route>
      <Route path="/EquipmentManagementSelectAdd" element={<EquipmentManagementSelectAdd />}></Route>
      <Route path="/UserAuthoriySelect" element={<UserAuthoriySelect />}></Route>
      <Route path="/QandAConfirm" element={<QandAConfirm />}></Route>
    </Routes>
  );
}


const GovernmentAppMenuItems = [
  {
    title: "Home",
    path: "/Main_government",
    icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />,
  },
  {
    title: "기관 관리",
    icon: (
      <ApartmentIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
    ),
    childrens: [
      {
        title: "기관 조회",
        path: "/AgencySelect",
      },
      {
        title: "사용자 계정 승인",
        path: "/UserSelectOk",
      },
    ],
  },
  {
    title: "건강 관리",
    path:"/Healthcare",
    icon: (
      <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
    ),
  },
  {
    title: "진료 관리",
    path:"/Medicalcare",
    icon: (
      <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
    ),
  },
  {
    title: "문의 현황 관리",
    path: "/QandASelect",
    icon: (
      <SpeakerPhoneIcon
        sx={{ fontSize: 20, color: "#333333", marginRight: 1 }}
      />
    ),
  },
  {
    title: "설정 관리",
    icon: (
      <SettingsIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
    ),
    childrens: [
      {
        title: "위험 기준 관리",
        path: "/RiskSet",
      },
      {
        title: "사용자 권한 관리",
        path: "/AuthorityManagement",
      },
    ],
  },
];
function GovernmentAppRoute() {
  return (
    <Routes>
      <Route path="/Medicalcare" element={<Medicalcare />}></Route>
      <Route path="/Healthcare" element={<Healthcare />}></Route>
      <Route path="/Main_government" element={<Main_government />}></Route>
      <Route path="/AgencySelect" element={<AgencySelect />}></Route>
      <Route path="/UserSelectOk" element={<UserSelectOk />}></Route>      
      <Route
        path="/MedicineCareSelectOne"
        element={<MedicineCareSelectOne />}
      ></Route>      
      <Route
        path="/TemperatureManagementSelectOne"
        element={<TemperatureManagementSelectOne />}
      ></Route>
      <Route
        path="/MedicineStatistics"
        element={<MedicineStatistics />}
      ></Route>
      <Route path="/VisitInsert" element={<VisitInsert />}></Route>
      <Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route>
      <Route
        path="/UserAuthoriySelect"
        element={<UserAuthoriySelect />}
      ></Route>
      <Route path="/RiskSet" element={<RiskSet />}></Route>
      <Route path="/AuthorityManagement" element={<AuthorityManagement />}></Route>
      <Route path="/QandASelect" element={<QandASelect />}></Route>
      <Route path="/QandAConfirm" element={<QandAConfirm />}></Route>
      <Route path="/QandAInsert" element={<QandAInsert />}></Route>
      <Route path="/ProtectorSelect" element={<ProtectorSelect />}></Route>
      <Route path="/SeniorInsert" element={<SeniorInsert />}></Route>
      <Route path="/AgencyInsert" element={<AgencyInsert />}></Route>
      <Route path="/Join" element={<Join />}></Route>
    </Routes>
  );
}
const AgencyAppMenuItems = [
  {
    title: "Home",
    path: "/Main_agency",
    icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />,
  },
  {
    title: "대상자 관리",
    path: "/UserAuthoriySelect_agency",
    icon: (
      <PersonIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
    ),
  },
  {
    title: "건강 관리",
    path:"/Healthcare",
    icon: (
      <Diversity1Icon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
    ),
  },
  {
    title: "진료 관리",
    path:"/Medicalcare",
    icon: (
      <LocalHospitalIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
    ),
  },
  {
    title: "장비 관리",
    icon: (
      <ConstructionIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />
    ),
    childrens: [
      {
        title: "장비 대여 관리",
        path: "/EquipmentManagementSelect",
      },
      {
        title: "문의게시판",
        path: "/QandASelect",
      },
    ]
  },
  {
    title: "Q&A",
    path: "/QuestionSelect",
    icon: (
      <SpeakerPhoneIcon
        sx={{ fontSize: 20, color: "#333333", marginRight: 1 }}
      />
    ),
  },
];
function AgencyAppRoute() {
  return (
    <Routes>
      <Route path="/Medicalcare" element={<Medicalcare />}></Route>
      <Route path="/Healthcare" element={<Healthcare />}></Route>
      <Route path="/Join" element={<Join />}></Route>
      <Route path="/QuestionSelect" element={<QuestionSelect />}></Route>
      <Route path="/QuestionInsert" element={<QuestionInsert />}></Route>
      <Route path="/Main_agency" element={<Main_agency />}></Route>
      <Route path="/UserAuthoriySelect_agency" element={<UserAuthoriySelect_agency />}></Route>
      <Route path="/SeniorInsert" element={<SeniorInsert />}></Route>
      <Route path="/SeniorSelectOne" element={<SeniorSelectOne />}></Route>
      <Route
        path="/MedicineCareSelectOne"
        element={<MedicineCareSelectOne />}
      ></Route>      
      <Route
        path="/TemperatureManagementSelectOne"
        element={<TemperatureManagementSelectOne />}
      ></Route>
      <Route path="/VisitInsert" element={<VisitInsert />}></Route>
      <Route path="/VisitSelectOne" element={<VisitSelectOne />}></Route>
      <Route
        path="/EquipmentRentalInsert"
        element={<EquipmentRentalInsert />}
      ></Route>
      <Route
        path="/EquipmentManagementSelect"
        element={<EquipmentManagementSelect />}
      ></Route>
      <Route
        path="/EquipmentManagementSelectOne"
        element={<EquipmentManagementSelectOne />}
      ></Route>
      <Route
        path="/QandASelect"
        element={<QandASelect />}
      ></Route>
      <Route
        path="/QandAInsert"
        element={<QandAInsert />}
      ></Route>
      <Route
        path="/QandAConfirm"
        element={<QandAConfirm />}
      ></Route>
    </Routes>
  );
}
const GuardianAppMenuItems = [
  {
    title: "Home",
    path: "/Main_guardian",
    icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />,
  },
  {
    title: "그래프로 보기",
    path: "/GuardianStatistics",
    icon: <EqualizerIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />,
  },
  {
    title: "Q&A",
    path: "/QuestionSelect",
    icon: (
      <SpeakerPhoneIcon
        sx={{ fontSize: 20, color: "#333333", marginRight: 1 }}
      />
    ),
  },
];
function GuardianAppRoute() {
  return (
    <Routes>
       <Route path="/GuardianStatistics" element={<GuardianStatistics />}></Route>
      <Route path="/Main_guardian" element={<Main_guardian />}></Route>
      <Route path="/QuestionSelect" element={<QuestionSelect />}></Route>
      <Route path="/QuestionConfirm" element={<QuestionConfirm />}></Route>
      <Route path="/QuestionInsert" element={<QuestionInsert />}></Route>
    </Routes>
  );
}

const AllApp = { 'menuItems': AllAppMenuItems, 'AppRoute': AllAppRoute };
const AdminApp = { 'menuItems': AdminAppMenuItems, 'AppRoute': AdminAppRoute };
const GovernmentApp = { 'menuItems': GovernmentAppMenuItems, 'AppRoute': GovernmentAppRoute };
const AgencyApp = { 'menuItems': AgencyAppMenuItems, 'AppRoute': AgencyAppRoute };
const GuardianApp = { 'menuItems': GuardianAppMenuItems, 'AppRoute': GuardianAppRoute };

export default AllApp;
export { AdminApp, GovernmentApp, GuardianApp, AgencyApp };
