const pcMenuIcon = require.context(
  "@mega-design/icons/svg/pcMenu",
  false,
  /\.svg$/
);
const mobileMenuIcon = require.context(
  "@mega-design/icons/svg/mobileMenu",
  false,
  /\.svg$/
);

const requireAll = (requireContext) => requireContext.keys();

const re = /\.\/(.*)\.svg/;

const pcIcons = requireAll(pcMenuIcon).map((i) => {
  return i.match(re)[1];
});

const mobileIcons = requireAll(mobileMenuIcon).map((i) => {
  return i.match(re)[1];
});

export default {
  pcIcons,
  mobileIcons,
};
