import Alert from 'react-bootstrap/Alert' import YouTube from '../svgs/youtube-line.svg' import { useEffect, useState } from 'react' import { gql, useQuery } from '@apollo/client' import { dayPivot } from '../lib/time' export default function Snl ({ ignorePreference }) { const [show, setShow] = useState() const { data } = useQuery(gql`{ snl }`, { fetchPolicy: 'cache-and-network' }) useEffect(() => { const dismissed = window.localStorage.getItem('snl') if (!ignorePreference && dismissed && dismissed > new Date(dismissed) < dayPivot(new Date(), -6)) { return } setShow(data?.snl) }, [data, ignorePreference]) if (!show) return null return (