import { useState, useEffect } from 'react';
import { getPanelMenu } from '../services';

export default function useMenuList() {
  const [list, setList] = useState([]);
  useEffect(() => {
    getPanelMenu().then((res) => {
      if (res.code === 1) {
        setList(res.data);
      }
    });
  }, []);
  return {
    list,
  };
}
