Consolidate AdminInsights files

This commit is contained in:
Sam Becker 2025-02-13 19:59:09 -06:00
parent ffa2d33514
commit b3010ca397
7 changed files with 13 additions and 13 deletions

View File

@ -10,7 +10,7 @@ import { useAppState } from '@/state/AppState';
import { BiCog } from 'react-icons/bi';
import { ImCheckboxUnchecked } from 'react-icons/im';
import { IoCloseSharp } from 'react-icons/io5';
import AdminAppInsightsIcon from './AdminAppInsightsIcon';
import AdminAppInsightsIcon from './insights/AdminAppInsightsIcon';
export default function AdminAppMenu() {
const {

View File

@ -20,7 +20,7 @@ import { usePathname } from 'next/navigation';
import { useEffect, useMemo, useState } from 'react';
import { FaRegClock } from 'react-icons/fa';
import { HiOutlineCog } from 'react-icons/hi';
import AdminAppInsightsIcon from './AdminAppInsightsIcon';
import AdminAppInsightsIcon from './insights/AdminAppInsightsIcon';
// Updates considered recent if they occurred in past 5 minutes
const areTimesRecent = (dates: Date[]) => dates

View File

@ -14,7 +14,7 @@ import {
VERCEL_GIT_REPO_OWNER,
VERCEL_GIT_REPO_SLUG,
} from '@/app-core/config';
import { getGitHubMetaWithFallback } from './github';
import { getGitHubMetaWithFallback } from '../github';
const owner = VERCEL_GIT_REPO_OWNER;
const repo = VERCEL_GIT_REPO_SLUG;

View File

@ -24,18 +24,11 @@ import {
TEMPLATE_REPO_NAME,
VERCEL_GIT_COMMIT_SHA_SHORT,
} from '@/app-core/config';
import { AdminAppInsight } from './insights';
const DEBUG_COMMIT_SHA = '4cd29ed';
const DEBUG_COMMIT_MESSAGE = 'Long commit message for debugging purposes';
type Recommendation =
'fork' |
'forkBehind' |
'ai' |
'aiRateLimiting' |
'photoMatting' |
'gridFirst';
export default function AdminAppInsightsClient({
codeMeta,
photoStats: {
@ -50,7 +43,7 @@ export default function AdminAppInsightsClient({
debug,
}: {
codeMeta?: Awaited<ReturnType<typeof getGitHubMetaWithFallback>>
recommendations: Record<Recommendation, boolean>
recommendations: Record<AdminAppInsight, boolean>
photoStats: {
photosCount: number
photosCountHidden: number

View File

@ -0,0 +1,7 @@
export type AdminAppInsight =
'fork' |
'forkBehind' |
'ai' |
'aiRateLimiting' |
'photoMatting' |
'gridFirst';

View File

@ -1,4 +1,4 @@
import AdminAppInsights from '@/admin/AdminAppInsights';
import AdminAppInsights from '@/admin/insights/AdminAppInsights';
import AdminInfoPage from '@/admin/AdminInfoPage';
import GitHubForkStatusBadge from '@/admin/github/GitHubForkStatusBadge';
import {