Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

PullRequestActivityUnavailableState.tsx

34 lines889 Bytes

1import { RefreshIcon } from "~/components/ui/refresh-icon";
2​
3import { cn } from "~/lib/utils";
4​
5import { Button } from "../ui/button";
6​
7export function PullRequestActivityUnavailableState({
8 error,
9 term,
10 onRetry,
11 compact = false,
12}: {
13 error: string;
14 /** The host's word for a change request, as in "pull request". */
15 term: string;
16 onRetry: () => void;
17 compact?: boolean;
18}) {
19 return (
20 <div
21 className={cn(
22 "flex flex-col items-center justify-center gap-2 text-center",
23 compact ? "py-3" : "min-h-48 px-4 py-10",
24 )}
25 >
26 <p className="text-sm font-medium text-foreground">Could not load {term} activity</p>
27 <p className="max-w-md text-xs text-muted-foreground">{error}</p>
28 <Button size="sm" variant="outline" onClick={onRetry}>
29 <RefreshIcon aria-hidden size="sm" />
30 Retry
31 </Button>
32 </div>
33 );