"use client" import { memo, useSyncExternalStore } from "react" import { DOCS_PAGE_GAP_PX } from "@/lib/drive/docs-page-layout-constants" import { getDocsGraphicSnapGuideState, subscribeDocsGraphicSnapGuides, } from "@/lib/drive/docs-graphic-snap-bridge" function DocsGraphicSnapGuidesInner({ pageWidth, pageHeight, }: { pageWidth: number pageHeight: number }) { const state = useSyncExternalStore( subscribeDocsGraphicSnapGuides, getDocsGraphicSnapGuideState, () => null ) if (!state || state.guides.length === 0) return null const pageTop = state.pageIndex * (pageHeight + DOCS_PAGE_GAP_PX) return (
{state.guides.map((guide, index) => guide.axis === "x" ? (
) : (
) )}
) } export const DocsGraphicSnapGuides = memo(DocsGraphicSnapGuidesInner)