import { useCreation as u } from "ahooks";
function i({ session: e, roles: n = ["owner", "admin"], children: r }) {
  const t = u(() => n.includes(e?.user?.role || "guest"), [e?.user?.role, n]);
  return typeof r == "function" ? r({ hasPermission: t }) : t ? r : null;
}
export {
  i as default
};
