Stub out admin info page

This commit is contained in:
Sam Becker 2025-02-09 20:50:14 -06:00
parent 23eb87edd9
commit 4209cabfe1
3 changed files with 29 additions and 0 deletions

View File

@ -7,8 +7,10 @@ import SiteGrid from '@/components/SiteGrid';
import Spinner from '@/components/Spinner';
import {
PATH_ADMIN_CONFIGURATION,
PATH_ADMIN_INFO,
checkPathPrefix,
isPathAdminConfiguration,
isPathAdminInfo,
isPathTopLevelAdmin,
} from '@/site/paths';
import { useAppState } from '@/state/AppState';
@ -18,6 +20,7 @@ import { usePathname } from 'next/navigation';
import { useEffect, useMemo, useState } from 'react';
import { BiCog } from 'react-icons/bi';
import { FaRegClock } from 'react-icons/fa';
import { TbInfoSquareRounded } from 'react-icons/tb';
// Updates considered recent if they occurred in past 5 minutes
const areTimesRecent = (dates: Date[]) => dates
@ -86,6 +89,25 @@ export default function AdminNavClient({
<span>({count})</span>}
</LinkWithStatus>)}
</div>
<span className="inline-flex relative">
<LinkWithLoader
href={PATH_ADMIN_INFO}
className={isPathAdminInfo(pathname)
? 'font-bold'
: 'text-dim'}
loader={<Spinner />}
>
<TbInfoSquareRounded
size={19}
className="inline-flex translate-y-0.5"
aria-label="App Configuration"
/>
</LinkWithLoader>
<span className={clsx(
'absolute top-[1px] right-[-1px] w-2 h-2 rounded-full',
'bg-blue-600',
)} />
</span>
<LinkWithLoader
href={PATH_ADMIN_CONFIGURATION}
className={isPathAdminConfiguration(pathname)

View File

@ -0,0 +1,3 @@
export default function AdminInfoPage() {
return <div>Admin Info</div>;
}

View File

@ -39,6 +39,7 @@ export const PATH_ADMIN_OUTDATED = `${PATH_ADMIN}/outdated`;
export const PATH_ADMIN_UPLOADS = `${PATH_ADMIN}/uploads`;
export const PATH_ADMIN_TAGS = `${PATH_ADMIN}/tags`;
export const PATH_ADMIN_CONFIGURATION = `${PATH_ADMIN}/configuration`;
export const PATH_ADMIN_INFO = `${PATH_ADMIN}/info`;
export const PATH_ADMIN_BASELINE = `${PATH_ADMIN}/baseline`;
// Debug paths
@ -213,6 +214,9 @@ export const isPathTopLevelAdmin = (pathname?: string) =>
export const isPathAdminConfiguration = (pathname?: string) =>
checkPathPrefix(pathname, PATH_ADMIN_CONFIGURATION);
export const isPathAdminInfo = (pathname?: string) =>
checkPathPrefix(pathname, PATH_ADMIN_INFO);
export const isPathProtected = (pathname?: string) =>
checkPathPrefix(pathname, PATH_ADMIN) ||
checkPathPrefix(pathname, pathForTag(TAG_HIDDEN)) ||