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

DiffFileStatus.tsx

30 lines926 Bytes

1import { useGT } from "gt-react";
2import { InfoIcon, RotateCwIcon } from "lucide-react";
3import { Button } from "../ui/button";
4import { SharedTooltipTrigger } from "../ui/shared-tooltip";
5​
6export function DiffFileStatus({ error, retry }: { error: boolean; retry: () => void }) {
7 const gt = useGT();
8 return (
9 <SharedTooltipTrigger
10 render={
11 <Button
12 size="icon-micro"
13 variant="ghost-muted"
14 aria-label={error ? gt`Retry loading diff` : gt`Partial diff preview`}
15 onClick={(event) => {
16 event.stopPropagation();
17 if (error) retry();
18 }}
19 />
20 }
21 label={
22 error
23 ? gt`Retry loading diff`
24 : gt`This file is too large to show in full. Counts include all changes.`
25 }
26 >
27 {error ? <RotateCwIcon className="size-3" /> : <InfoIcon className="size-3" />}
28 </SharedTooltipTrigger>
29 );