import styles from '../DrawPDFFields/style.module.scss' import { PdfPage } from '../../types/drawing.ts' import { CurrentUserMark, Mark } from '../../types/mark.ts' import PdfMarkItem from './PdfMarkItem.tsx' import { useEffect, useRef } from 'react' import pdfViewStyles from './style.module.scss' import { FONT_SIZE, FONT_TYPE, inPx } from '../../utils/pdf.ts' interface PdfPageProps { currentUserMarks: CurrentUserMark[] handleMarkClick: (id: number) => void otherUserMarks: Mark[] page: PdfPage selectedMark: CurrentUserMark | null selectedMarkValue: string } /** * Responsible for rendering a single Pdf Page and its Marks */ const PdfPageItem = ({ page, currentUserMarks, handleMarkClick, selectedMarkValue, selectedMark, otherUserMarks }: PdfPageProps) => { useEffect(() => { if (selectedMark !== null && !!markRefs.current[selectedMark.id]) { markRefs.current[selectedMark.id]?.scrollIntoView({ behavior: 'smooth' }) } }, [selectedMark]) const markRefs = useRef<(HTMLDivElement | null)[]>([]) return (