The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { useGT } from "gt-react"; |
| 2 | import { InfoIcon, RotateCwIcon } from "lucide-react"; |
| 3 | import { Button } from "../ui/button"; |
| 4 | import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; |
| 5 | |
| 6 | export 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 | } |