import React, { useEffect, useState } from 'react'; import ContentBox from '@/components/elements/ContentBox'; import CreateApiKeyForm from '@/components/dashboard/forms/CreateApiKeyForm'; import getApiKeys, { ApiKey } from '@/api/account/getApiKeys'; import SpinnerOverlay from '@/components/elements/SpinnerOverlay'; import { Simulate } from 'react-dom/test-utils'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faKey } from '@fortawesome/free-solid-svg-icons/faKey'; import { faTrashAlt } from '@fortawesome/free-solid-svg-icons/faTrashAlt'; export default () => { const [ keys, setKeys ] = useState([]); const [ loading, setLoading ] = useState(true); useEffect(() => { getApiKeys() .then(keys => setKeys(keys)) .then(() => setLoading(false)) .catch(error => { console.error(error); }); }, []); return (
{ keys.map(key => (

{key.description}

{key.identifier}

)) }
); };