Add insights empty state
This commit is contained in:
parent
b9baf65bf9
commit
6078fe8385
29
src/admin/AdminEmptyState.tsx
Normal file
29
src/admin/AdminEmptyState.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
import clsx from 'clsx/lite';
|
||||
import { ReactNode } from 'react';
|
||||
import { IoInformationCircleOutline } from 'react-icons/io5';
|
||||
|
||||
export default function AdminEmptyState({
|
||||
icon,
|
||||
children,
|
||||
includeContainer = true,
|
||||
}: {
|
||||
icon?: ReactNode
|
||||
children: ReactNode
|
||||
includeContainer?: boolean
|
||||
}) {
|
||||
return (
|
||||
<div className={clsx(
|
||||
'flex flex-col gap-4 justify-center items-center p-8',
|
||||
includeContainer &&'component-surface shadow-xs',
|
||||
)}>
|
||||
<div className={clsx(
|
||||
'size-14 flex justify-center items-center',
|
||||
'text-[1.75rem] text-medium',
|
||||
'border border-main rounded-xl shadow-xs',
|
||||
)}>
|
||||
{icon ?? <IoInformationCircleOutline />}
|
||||
</div>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -31,6 +31,7 @@ import { LiaBroomSolid } from 'react-icons/lia';
|
||||
import { IoMdGrid } from 'react-icons/io';
|
||||
import { RiSpeedMiniLine } from 'react-icons/ri';
|
||||
import AdminLink from '../AdminLink';
|
||||
import AdminEmptyState from '../AdminEmptyState';
|
||||
|
||||
const DEBUG_COMMIT_SHA = '4cd29ed';
|
||||
const DEBUG_COMMIT_MESSAGE = 'Long commit message for debugging purposes';
|
||||
@ -93,8 +94,8 @@ export default function AdminAppInsightsClient({
|
||||
|
||||
return (
|
||||
<div className="space-y-6 md:space-y-8">
|
||||
{(codeMeta?.isBaseRepo || codeMeta?.isForkedFromBase || debug) && <>
|
||||
<ScoreCard title="Build details">
|
||||
{(codeMeta || debug) && <>
|
||||
<ScoreCard title="Source code">
|
||||
{(noFork || debug) &&
|
||||
<ScoreCardRow
|
||||
icon={<FaCircleInfo
|
||||
@ -195,8 +196,9 @@ export default function AdminAppInsightsClient({
|
||||
/>
|
||||
</ScoreCard>
|
||||
</>}
|
||||
{(hasTemplateRecommendations(insights) || debug) &&
|
||||
<ScoreCard title="Template recommendations">
|
||||
{(hasTemplateRecommendations(insights) || debug)
|
||||
? <>
|
||||
{(noAiRateLimiting || debug) && <ScoreCardRow
|
||||
icon={<PiWarningBold
|
||||
size={17}
|
||||
@ -276,10 +278,15 @@ export default function AdminAppInsightsClient({
|
||||
{' '}
|
||||
default view to grid by setting
|
||||
{' '}
|
||||
{/* eslint-disable-next-line max-len */}
|
||||
<EnvVar variable="NEXT_PUBLIC_GRID_HOMEPAGE_ENABLED" value="1" />.
|
||||
</>}
|
||||
/>}
|
||||
</ScoreCard>}
|
||||
</>
|
||||
: <AdminEmptyState includeContainer={false}>
|
||||
Nothing to report!
|
||||
</AdminEmptyState>}
|
||||
</ScoreCard>
|
||||
<ScoreCard title="Library Stats">
|
||||
{(outdatedPhotos || debug) && <ScoreCardRow
|
||||
icon={<LiaBroomSolid
|
||||
|
||||
Loading…
Reference in New Issue
Block a user