import { useEffect, useState } from "react";
import { RoleAPI } from "@/api";
import { limitEntity } from "@/api/modules/role";

function useOptionShow(id: number) {
  // const [show, setShow] = useState<boolean>(false);
  return JSON.parse(localStorage.getItem("routeList") as string).some(
    (v: limitEntity) => v.id === id
  );
  // useEffect(() => {
  //   RoleAPI.getListCuserMenuInfo().then((res: any) => {
  //     const bol: boolean = res.result.some((v: limitEntity) => v.id === id);
  //     setShow(bol);
  //   });
  // }, []);
  // return show;
}
export default useOptionShow;
