Consolidate AdminInsights files
This commit is contained in:
parent
ffa2d33514
commit
b3010ca397
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
@ -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
|
||||
7
src/admin/insights/index.ts
Normal file
7
src/admin/insights/index.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export type AdminAppInsight =
|
||||
'fork' |
|
||||
'forkBehind' |
|
||||
'ai' |
|
||||
'aiRateLimiting' |
|
||||
'photoMatting' |
|
||||
'gridFirst';
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user