This commit is contained in:
Matthew Penner 2020-10-04 14:25:58 -06:00
parent df6f5c3a09
commit e7aeeace26
18 changed files with 614 additions and 65 deletions

View file

@ -1,12 +1,22 @@
import React, { useState } from 'react';
import NewApiKeyButton from '@/components/admin/api/NewApiKeyButton';
import React, { useEffect, useState } from 'react';
import tw from 'twin.macro';
import AdminContentBlock from '@/components/admin/AdminContentBlock';
import Button from '@/components/elements/Button';
import Spinner from '@/components/elements/Spinner';
interface Key {
id: number,
}
export default () => {
const [ loading ] = useState<boolean>(false);
const [ keys ] = useState<any[]>([]);
const [ loading, setLoading ] = useState<boolean>(true);
const [ keys ] = useState<Key[]>([]);
useEffect(() => {
setTimeout(() => {
setLoading(false);
}, 500);
});
return (
<AdminContentBlock>
@ -16,16 +26,14 @@ export default () => {
<p css={tw`text-base text-neutral-400`}>Control access credentials for managing this Panel via the API.</p>
</div>
<Button type={'button'} size={'large'} css={tw`h-10 ml-auto px-4 py-0`}>
New API Key
</Button>
<NewApiKeyButton />
</div>
<div css={tw`w-full flex flex-col`}>
<div css={tw`w-full flex flex-col bg-neutral-700 rounded-lg shadow-md`}>
{ loading ?
<div css={tw`w-full flex flex-col items-center justify-center`} style={{ height: '24rem' }}>
<Spinner/>
<Spinner size={'base'}/>
</div>
:
keys.length < 1 ?