import {OSGBackend} from '@jaenjs/snek-finder/src/backends/OSGBackend' import {graphql, useStaticQuery} from 'gatsby' import React from 'react' const SnekFinderProvider = React.lazy(() => import('@jaenjs/snek-finder').then(module => ({ default: module.SnekFinderProvider })) ) export const Backend = new OSGBackend('snek-finder-osg-backend-root') export const SnekFinder: React.FC = ({children}) => { const isSSR = typeof window === 'undefined' let finderUrl try { const data = useStaticQuery<{ jaenInternal: { finderUrl: string | null } }>(graphql` query JaenInternal { jaenInternal { finderUrl } } `) finderUrl = data.jaenInternal.finderUrl } catch { finderUrl = null } return ( {!isSSR && ( {children} )} ) } export const withSnekFinder =

( Component: React.ComponentType> ): React.FC> => props => { return ( ) }