fix web build warnings (#348)

This commit is contained in:
Michael Sukkarieh 2025-06-13 10:24:25 -07:00 committed by GitHub
parent 224460d96c
commit 4fbf8059d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -54,7 +54,7 @@ export const LightweightCodeHighlighter = memo<LightweightCodeHighlighter>((prop
const isFileTooLargeToDisplay = useMemo(() => {
return unhighlightedLines.some(line => line.length > MAX_NUMBER_OF_CHARACTER_PER_LINE);
}, [code]);
}, [unhighlightedLines]);
const [highlightedLines, setHighlightedLines] = useState<React.ReactNode[] | null>(null);
@ -106,7 +106,8 @@ export const LightweightCodeHighlighter = memo<LightweightCodeHighlighter>((prop
highlightRanges,
highlightStyle,
unhighlightedLines,
lineNumbersOffset
lineNumbersOffset,
isFileTooLargeToDisplay,
]);
const lineCount = (highlightedLines ?? unhighlightedLines).length + lineNumbersOffset;

View file

@ -4,7 +4,6 @@ import { getCodeHostInfoForRepo } from "@/lib/utils";
import { LaptopIcon } from "@radix-ui/react-icons";
import clsx from "clsx";
import Image from "next/image";
import Link from "next/link";
import { useBrowseNavigation } from "../browse/hooks/useBrowseNavigation";
import { Copy, CheckCircle2, ChevronRight, MoreHorizontal } from "lucide-react";
import { useCallback, useState, useMemo, useRef, useEffect } from "react";