import { useMemo } from "react"; import { IconAlertTriangle } from "@tabler/icons-react"; import { reviewFileKey } from "@/components/review/types"; /** Composite key for the file currently selected in single-file mode. */ export function useSelectedFileKey( mode: "all" | "file", filePath: string | undefined, fileRepositoryName: string | undefined, ): string | undefined { return useMemo( () => mode === "file" && filePath ? reviewFileKey({ path: filePath, repository_name: fileRepositoryName }) : undefined, [mode, filePath, fileRepositoryName], ); } /** Banner shown when the backend dropped files from a huge cumulative diff * (large rebase) to keep the rendered row count bounded. */ export function TruncatedFilesBanner({ count }: { count: number }) { if (count <= 0) return null; return (