import React, { useEffect, useState } from 'react'; import FullMottoLogo, { LogoType } from '@nirvana/components/logo/fullMotto'; type Quote = { content: string; author: string; length: number; dateAdded: Date; _id: string; tags: string[]; }; export default function FlowState({ handleReconnect }: { handleReconnect: () => void }) { const [quote, setQuote] = useState(null); useEffect(() => { fetch('https://api.quotable.io/random') .then((res) => res.json()) .then((data: Quote) => { console.warn(data); setQuote(data); }) .catch((error) => { // do nothing, don't bother user, just don't show the quote console.warn(error); }); }, []); return (
{/* */} {quote && ( {`"${quote.content}"`} {quote.author} )}
); }