diff --git a/src/photo/PhotosEmptyState.tsx b/src/photo/PhotosEmptyState.tsx index b3f471b7..26bb0541 100644 --- a/src/photo/PhotosEmptyState.tsx +++ b/src/photo/PhotosEmptyState.tsx @@ -1,14 +1,12 @@ import InfoBlock from '@/components/InfoBlock'; import SiteGrid from '@/components/SiteGrid'; -import { CONFIG_CHECKLIST_STATUS } from '@/site/config'; +import { IS_CHECKLIST_COMPLETE } from '@/site/config'; import SiteChecklist from '@/site/SiteChecklist'; import { cc } from '@/utility/css'; import Link from 'next/link'; import { HiOutlinePhotograph } from 'react-icons/hi'; export default function PhotosEmptyState() { - const showChecklist = Object.values(CONFIG_CHECKLIST_STATUS).some(v => !v); - return ( - {showChecklist ? 'Finish Setup' : 'Welcome!'} + {!IS_CHECKLIST_COMPLETE ? 'Finish Setup' : 'Welcome!'} - {showChecklist + {!IS_CHECKLIST_COMPLETE ? :
diff --git a/src/site/config.ts b/src/site/config.ts index 3b2d9e16..cd5ed052 100644 --- a/src/site/config.ts +++ b/src/site/config.ts @@ -31,3 +31,10 @@ export const CONFIG_CHECKLIST_STATUS = { (process.env.ADMIN_PASSWORD ?? '').length > 0 ), }; + +export const IS_CHECKLIST_COMPLETE = + CONFIG_CHECKLIST_STATUS.hasTitle && + CONFIG_CHECKLIST_STATUS.hasPostgres && + CONFIG_CHECKLIST_STATUS.hasBlob && + CONFIG_CHECKLIST_STATUS.hasAuth && + CONFIG_CHECKLIST_STATUS.hasAdminUser;