diff --git a/src/admin/AdminEmptyState.tsx b/src/admin/AdminEmptyState.tsx new file mode 100644 index 00000000..3eaef77f --- /dev/null +++ b/src/admin/AdminEmptyState.tsx @@ -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 ( +
+
+ {icon ?? } +
+ {children} +
+ ); +} \ No newline at end of file diff --git a/src/admin/insights/AdminAppInsightsClient.tsx b/src/admin/insights/AdminAppInsightsClient.tsx index 392d0e17..7d49248f 100644 --- a/src/admin/insights/AdminAppInsightsClient.tsx +++ b/src/admin/insights/AdminAppInsightsClient.tsx @@ -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 (
- {(codeMeta?.isBaseRepo || codeMeta?.isForkedFromBase || debug) && <> - + {(codeMeta || debug) && <> + {(noFork || debug) && } - {(hasTemplateRecommendations(insights) || debug) && - - {(noAiRateLimiting || debug) && + {(hasTemplateRecommendations(insights) || debug) + ? <> + {(noAiRateLimiting || debug) && } + content="AI enabled without rate limiting" + expandContent={<> + Create Vercel KV store and link to this project + in order prevent abuse by to enabling rate limiting. + } />} - content="AI enabled without rate limiting" - expandContent={<> - Create Vercel KV store and link to this project - in order prevent abuse by to enabling rate limiting. - } - />} - {(noStaticOptimization || debug) && } + content="Speed up page load times" + expandContent={<> + Improve load times by enabling static optimization + {' '} + on: +
+ {renderLabeledEnvVar( + 'Photo pages', + 'NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTOS', + )} + {renderLabeledEnvVar( + 'Photo OG images', + 'NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_OG_IMAGES', + )} + {renderLabeledEnvVar( + 'Category pages (tags, cameras, etc.)', + 'NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_CATEGORIES', + )} + {renderLabeledEnvVar( + 'Category OG images', + 'NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_CATEGORY_OG_IMAGES', + )} + + See {readmeAnchor('performance')} for cost implications. + +
+ } />} - content="Speed up page load times" - expandContent={<> - Improve load times by enabling static optimization - {' '} - on: -
- {renderLabeledEnvVar( - 'Photo pages', - 'NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTOS', - )} - {renderLabeledEnvVar( - 'Photo OG images', - 'NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_OG_IMAGES', - )} - {renderLabeledEnvVar( - 'Category pages (tags, cameras, etc.)', - 'NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_CATEGORIES', - )} - {renderLabeledEnvVar( - 'Category OG images', - 'NEXT_PUBLIC_STATICALLY_OPTIMIZE_PHOTO_CATEGORY_OG_IMAGES', - )} - - See {readmeAnchor('performance')} for cost implications. - -
- } - />} - {(noAi || debug) && } - content="Improve SEO + accessibility with AI" - expandContent={<> - Enable automatic AI text generation - {' '} - by setting . - {' '} - Further instruction and cost considerations in - {' '} - {readmeAnchor('ai-text-generation')}. - } - />} - {(photoMatting || debug) && } + content="Improve SEO + accessibility with AI" + expandContent={<> + Enable automatic AI text generation + {' '} + by setting . + {' '} + Further instruction and cost considerations in + {' '} + {readmeAnchor('ai-text-generation')}. + } />} - content="Vertical photos may benefit from matting" - expandContent={<> - Enable photo matting to make - {' '} - portrait and landscape photos appear more consistent - {' '} - . - } - />} - {(gridFirst || debug) && } - content="Grid homepage" - expandContent={<> - Now that you have enough photos, consider switching your - {' '} - default view to grid by setting - {' '} - . - } - />} -
} + {(photoMatting || debug) && } + content="Vertical photos may benefit from matting" + expandContent={<> + Enable photo matting to make + {' '} + portrait and landscape photos appear more consistent + {' '} + . + } + />} + {(gridFirst || debug) && } + content="Grid homepage" + expandContent={<> + Now that you have enough photos, consider switching your + {' '} + default view to grid by setting + {' '} + {/* eslint-disable-next-line max-len */} + . + } + />} + + : + Nothing to report! + } +
{(outdatedPhotos || debug) &&