Open History to see the last commit
1import { useGT } from "gt-react";
2import { InfoIcon, RotateCwIcon } from "lucide-react";
3import { Button } from "../ui/button";
4import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
5
6export function DiffFileStatus({
7 error,
8 truncated,
9 retry,
10}: {
11 error?: boolean | undefined;
12 truncated?: boolean | undefined;
13 retry: () => void;
14}) {
15 const gt = useGT();
16 if (!error && !truncated) return null;
17 return (
18 <Tooltip>
19 <TooltipTrigger
20 render={
21 <Button
22 size="icon-micro"
23 variant="ghost-muted"
24 aria-label={error ? gt("Retry loading diff") : gt("Partial diff preview")}
25 onClick={(event) => {
26 event.stopPropagation();
27 if (error) retry();
28 }}
29 />
30 }
31 >
32 {error ? <RotateCwIcon className="size-3" /> : <InfoIcon className="size-3" />}
33 </TooltipTrigger>
34 <TooltipPopup>
35 {error
36 ? gt("Retry loading diff")
37 : gt("This file is too large to show in full. Counts include all changes.")}
38 </TooltipPopup>
39 </Tooltip>
40 );
41}