import { IRemoteConfig } from '@magicbell/react-headless';
import { path, pathOr } from 'ramda';
import React from 'react';
interface Props {
config: IRemoteConfig;
}
/**
* Component that renders the web push subscription page in an invisible iframe
* to refresh the user's subscription.
*
* @example
*
*/
export default function WebPushRefresh({ config }: Props) {
const isWebPushEnabled = pathOr(false, ['webPush', 'enabled'], config.channels);
const subscribeUrl = path(['webPush', 'config', 'subscribeUrl'], config.channels);
if (!isWebPushEnabled) return null;
return (
);
}