import { PAYMENT_KIT_DID, isPaymentKitMounted } from '../libs/util';

export default function SafeGuard({ children }: { children: any }) {
  const mounted = isPaymentKitMounted();
  if (mounted === false) {
    console.warn(`PaymentKit is required to use this feature: https://store.blocklet.dev/blocklets/${PAYMENT_KIT_DID}`);
  }
  return mounted ? children : null;
}
