From c5e8098b0614982b620852a6247318e66a1979b5 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 16 Feb 2025 10:41:38 -0600 Subject: [PATCH] Display GitHub connectivity errors --- src/admin/insights/AdminAppInsightsClient.tsx | 109 ++++++++++-------- src/components/Tooltip.tsx | 16 ++- .../primitives/TooltipPrimitive.tsx | 4 +- 3 files changed, 77 insertions(+), 52 deletions(-) diff --git a/src/admin/insights/AdminAppInsightsClient.tsx b/src/admin/insights/AdminAppInsightsClient.tsx index 3f2996ff..5925a13a 100644 --- a/src/admin/insights/AdminAppInsightsClient.tsx +++ b/src/admin/insights/AdminAppInsightsClient.tsx @@ -33,6 +33,7 @@ import { RiSpeedMiniLine } from 'react-icons/ri'; import AdminLink from '../AdminLink'; import AdminEmptyState from '../AdminEmptyState'; import { pluralize } from '@/utility/string'; +import Tooltip from '@/components/Tooltip'; const DEBUG_COMMIT_SHA = '4cd29ed'; const DEBUG_COMMIT_MESSAGE = 'Long commit message for debugging purposes'; @@ -97,55 +98,71 @@ export default function AdminAppInsightsClient({
{(codeMeta || debug) && <> - {(noFork || debug) && - } - content="This template is not forked" - expandContent={<> - - Fork original template - - {' '} - to receive the latest fixes and features. - {' '} - Additional instructions in - {' '} - {readmeAnchor('receiving-updates')}. + content={<> + Could not analyze source code + } - />} - {(forkBehind || debug) && } - content={<> - This fork is - {' '} - - {codeMeta?.behindBy ?? DEBUG_BEHIND_BY} - {' '} - {(codeMeta?.behindBy ?? DEBUG_BEHIND_BY) === 1 - ? 'commit' - : 'commits'} - - {' '} - behind + /> + : <> + {(noFork || debug) && + } + content="This template is not forked" + expandContent={<> + + Fork original template + + {' '} + to receive the latest fixes and features. + {' '} + Additional instructions in + {' '} + {readmeAnchor('receiving-updates')}. + } + />} + {(forkBehind || debug) && } + content={<> + This fork is + {' '} + + {codeMeta?.behindBy ?? DEBUG_BEHIND_BY} + {' '} + {(codeMeta?.behindBy ?? DEBUG_BEHIND_BY) === 1 + ? 'commit' + : 'commits'} + + {' '} + behind + } + expandContent={<> + + Sync your fork + + {' '} + to receive the latest fixes and features. + } + />} } - expandContent={<> - - Sync your fork - - {' '} - to receive the latest fixes and features. - } - />} } content={
, -) { +export default function Tooltip({ + children, + ...rest +}: Omit, 'children'> & { + children?: ReactNode +}) { return ( - + + {children ?? } + ); } diff --git a/src/components/primitives/TooltipPrimitive.tsx b/src/components/primitives/TooltipPrimitive.tsx index f7f37e50..ad88a9cc 100644 --- a/src/components/primitives/TooltipPrimitive.tsx +++ b/src/components/primitives/TooltipPrimitive.tsx @@ -10,11 +10,13 @@ import useClickInsideOutside from '@/utility/useClickInsideOutside'; export default function TooltipPrimitive({ content, className, + classNameTrigger, sideOffset = 10, children, }: { content?: ReactNode className?: string + classNameTrigger?: string sideOffset?: number children: ReactNode }) { @@ -39,7 +41,7 @@ export default function TooltipPrimitive({