2020-10-04 20:25:58 +00:00
|
|
|
import NewApiKeyButton from '@/components/admin/api/NewApiKeyButton';
|
|
|
|
import React, { useEffect, useState } from 'react';
|
2020-08-22 22:49:18 +00:00
|
|
|
import tw from 'twin.macro';
|
|
|
|
import AdminContentBlock from '@/components/admin/AdminContentBlock';
|
|
|
|
import Spinner from '@/components/elements/Spinner';
|
|
|
|
|
2020-10-04 20:25:58 +00:00
|
|
|
interface Key {
|
|
|
|
id: number,
|
|
|
|
}
|
|
|
|
|
2020-08-22 22:49:18 +00:00
|
|
|
export default () => {
|
2020-10-04 20:25:58 +00:00
|
|
|
const [ loading, setLoading ] = useState<boolean>(true);
|
|
|
|
const [ keys ] = useState<Key[]>([]);
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
setLoading(false);
|
|
|
|
}, 500);
|
|
|
|
});
|
2020-08-22 22:49:18 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<AdminContentBlock>
|
|
|
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
|
|
|
<div css={tw`flex flex-col`}>
|
|
|
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>API Keys</h2>
|
|
|
|
<p css={tw`text-base text-neutral-400`}>Control access credentials for managing this Panel via the API.</p>
|
|
|
|
</div>
|
|
|
|
|
2020-10-04 20:25:58 +00:00
|
|
|
<NewApiKeyButton />
|
2020-08-22 22:49:18 +00:00
|
|
|
</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' }}>
|
2020-10-04 20:25:58 +00:00
|
|
|
<Spinner size={'base'}/>
|
2020-08-22 22:49:18 +00:00
|
|
|
</div>
|
|
|
|
:
|
|
|
|
keys.length < 1 ?
|
|
|
|
<div css={tw`w-full flex flex-col items-center justify-center pb-6 py-2 sm:py-8 md:py-10 px-8`}>
|
|
|
|
<div css={tw`h-64 flex`}>
|
2020-08-22 23:16:20 +00:00
|
|
|
<img src={'/assets/svgs/not_found.svg'} alt={'No Items'} css={tw`h-full select-none`}/>
|
2020-08-22 22:49:18 +00:00
|
|
|
</div>
|
|
|
|
|
2020-09-19 23:41:32 +00:00
|
|
|
<p css={tw`text-lg text-neutral-300 text-center font-normal sm:mt-8`}>No items could be found, it's almost like they are hiding.</p>
|
2020-08-22 22:49:18 +00:00
|
|
|
</div>
|
|
|
|
:
|
|
|
|
null
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</AdminContentBlock>
|
|
|
|
);
|
|
|
|
};
|