Apply same logic to databases

Same logic as PR #2088

Shows using x of x databases.
Once limit is reached the create button is removed
This commit is contained in:
Charles Morgan 2020-06-02 23:40:40 -04:00
parent 0795f8763d
commit 5e68290267
No known key found for this signature in database
GPG Key ID: D71946CD723249BD

View File

@ -36,6 +36,11 @@ export default () => {
return (
<PageContentBlock>
<FlashMessageRender byKey={'databases'} className={'mb-4'}/>
{featureLimits.databases !== 0 &&
<p className="text-center text-md text-neutral-400">
You are currently using {databases.length} of {featureLimits.databases} databases.
</p>
}
{(!databases.length && loading) ?
<Spinner size={'large'} centered={true}/>
:
@ -59,7 +64,7 @@ export default () => {
</p>
}
<Can action={'database.create'}>
{featureLimits.databases > 0 &&
{featureLimits.databases > 0 && featureLimits.databases !== databases.length &&
<div className={'mt-6 flex justify-end'}>
<CreateDatabaseButton/>
</div>