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

PullRequestsUnavailableState.tsx

43 lines1.1 KB

1import { GitPullRequestIcon, RefreshCwIcon } from "lucide-react";
2​
3import { Button } from "../ui/button";
4import {
5 Empty,
6 EmptyContent,
7 EmptyDescription,
8 EmptyHeader,
9 EmptyMedia,
10 EmptyTitle,
11} from "../ui/empty";
12​
13export function PullRequestsUnavailableState({
14 title = "Could not load pull requests",
15 error,
16 onRetry,
17}: {
18 title?: string;
19 error: string;
20 onRetry?: () => void;
21}) {
22 return (
23 <Empty className="px-4 py-16 md:px-4">
24 <EmptyMedia variant="icon">
25 <GitPullRequestIcon />
26 </EmptyMedia>
27 <EmptyHeader>
28 <EmptyTitle>{title}</EmptyTitle>
29 {/* The caller names the fix — update the environment, install gh, sign in — so this
30 shows its message rather than trying to infer one from the failure text. */}
31 <EmptyDescription>{error}</EmptyDescription>
32 </EmptyHeader>
33 {onRetry ? (
34 <EmptyContent>
35 <Button size="sm" variant="outline" onClick={onRetry}>
36 <RefreshCwIcon className="size-3.5" />
37 Retry
38 </Button>
39 </EmptyContent>
40 ) : null}
41 </Empty>
42 );