import { Access, useAccess } from '@umijs/max';
import { ReactNode } from 'react';

export default function MyAccess({
  children,
  theKey,
}: {
  children: ReactNode;
  theKey: string;
}) {
  const access = useAccess();
  return <Access accessible={access.canAccess(theKey)}>{children}</Access>;
}
