import React from "react";
import SidebarItem from "./SidebarItem.jsx";
import Button from "../component/Button.jsx";

export default function Sidebar({items}) {
  const [menuToggle, setMenuToggle] = React.useState(false);

  return (
    <nav
      className={!menuToggle ? "nav" : "burger__menu"}
      onClick={() => (menuToggle ? setMenuToggle(false) : setMenuToggle(true))}
    >
      <h1 className="logo">시니어 케어 시스템</h1>
      <div className="flex-align-column" style={{ height: `calc(100% - 72px)` }}>
        <ul>
          {items.map((item, index) => (
            <SidebarItem key={index} item={item} />
          ))}
        </ul>
        <div className="info-wrap ">
          <div className="bottom-section flex">
            <div className="info-id flex50">관리자</div>
            <Button className={"logout flex50"} btnName={"로그아웃"} />
          </div>
        </div>
      </div>
    </nav>
  );
}
