fix: refine GitHub rate limit card (#2668)
This commit is contained in:
@@ -19,12 +19,14 @@ export function GitHubAccessHelp({
|
||||
title,
|
||||
description,
|
||||
content,
|
||||
icon,
|
||||
onOpen,
|
||||
}: {
|
||||
label: string;
|
||||
title: string;
|
||||
description: string;
|
||||
content?: ReactNode;
|
||||
icon?: ReactNode;
|
||||
onOpen?: () => void;
|
||||
}) {
|
||||
const usesTouchDrawer = useTouchDrawer();
|
||||
@@ -43,7 +45,7 @@ export function GitHubAccessHelp({
|
||||
aria-expanded={usesTouchDrawer ? open : undefined}
|
||||
aria-label={label}
|
||||
>
|
||||
<IconInfoCircle className="h-4 w-4" />
|
||||
{icon ?? <IconInfoCircle className="h-4 w-4" />}
|
||||
</Button>
|
||||
);
|
||||
const trigger = usesTouchDrawer ? (
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import type { Locale } from "date-fns";
|
||||
import { IconAlertTriangle } from "@tabler/icons-react";
|
||||
import { IconAlertTriangle, IconGauge } from "@tabler/icons-react";
|
||||
import { Alert, AlertDescription } from "@kandev/ui/alert";
|
||||
import type { GitHubRateLimitInfo, GitHubRateLimitSnapshot } from "@/lib/types/github";
|
||||
import { GitHubAccessHelp } from "./github-access-help";
|
||||
@@ -75,6 +75,7 @@ export function GitHubRateLimitDisplay({
|
||||
label={t("github:showGithubApiLimits")}
|
||||
title={t("github:githubApiLimits")}
|
||||
description={t("github:currentGithubApiRateAndQuery")}
|
||||
icon={<IconGauge className="h-4 w-4" data-testid="github-rate-limit-icon" />}
|
||||
content={
|
||||
snapshots.length > 0 ? (
|
||||
<RateLimitDetails snapshots={snapshots} exhausted={exhausted} />
|
||||
|
||||
@@ -261,7 +261,7 @@ export function GitHubConnectionSection({ workspaceId }: { workspaceId: string }
|
||||
description={t("github:credentialUsedForRepositorySyncWatches")}
|
||||
>
|
||||
<Card data-testid="github-workspace-access-card">
|
||||
<CardContent className="pt-6">
|
||||
<CardContent className="pt-0">
|
||||
<GitHubAutomationSettings workspaceId={workspaceId} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user