import React, { useState, useEffect } from 'react' import LoadingIndicator from '../components/LoadingIndicator' import constants from '../constants.json' export default function UserQuestions (props) { const [qa, setQa] = useState(null) useEffect(() => { console.info('Fetching qa.json') fetch(`${constants.serverUrl}qa.json`) // eslint-disable-line .then((resp) => { return resp.json() }) .then((data) => { setQa(data) }) }, []) if (qa) { let questions = Object.keys(qa).map((key, i) => { let q = qa[key] return (