diff --git a/src/admin/insights/AdminAppInsightsClient.tsx b/src/admin/insights/AdminAppInsightsClient.tsx index c46d6db8..aae006bc 100644 --- a/src/admin/insights/AdminAppInsightsClient.tsx +++ b/src/admin/insights/AdminAppInsightsClient.tsx @@ -44,6 +44,8 @@ const DEBUG_COMMIT_MESSAGE = 'Long commit message for debugging purposes'; const DEBUG_BEHIND_BY = 9; const DEBUG_PHOTOS_COUNT_OUTDATED = 7; +const WARNING_TEXT_COLOR = 'text-amber-600 dark:text-amber-500'; + const readmeAnchor = (anchor: string) => README/{anchor} @@ -60,9 +62,13 @@ const renderLabeledEnvVar = (label: string, envVar: string, value = '1') => const renderHighlightText = ( text: string, color: 'blue' | 'yellow' = 'blue', + truncate = true, ) => } content={<> Could not analyze source code @@ -233,12 +239,13 @@ export default function AdminAppInsightsClient({ size={17} className={clsx( 'translate-x-[0.5px]', - 'text-amber-600 dark:text-amber-500', + WARNING_TEXT_COLOR, )} />} - content={renderHighlightText( + content={isExpanded => renderHighlightText( 'AI enabled without rate limiting', 'yellow', + !isExpanded, )} expandContent={<> Create Upstash Redis store from storage tab on @@ -332,7 +339,7 @@ export default function AdminAppInsightsClient({ size={19} className={clsx( 'translate-y-[-2px]', - 'text-amber-600 dark:text-amber-500', + WARNING_TEXT_COLOR, )} />} content={renderHighlightText( diff --git a/src/components/ScoreCardRow.tsx b/src/components/ScoreCardRow.tsx index ad0dbe6e..0600e5dd 100644 --- a/src/components/ScoreCardRow.tsx +++ b/src/components/ScoreCardRow.tsx @@ -22,7 +22,7 @@ export default function ScoreCardRow({ className, }: { icon: ReactNode - content: ReactNode + content: ReactNode | ((isExpanded?: boolean) => ReactNode) expandContent?: ReactNode expandPath?: string className?: string @@ -44,10 +44,11 @@ export default function ScoreCardRow({
- {content} + {typeof content === 'function' + ? content(isExpanded) + : content}
{isExpanded &&