function updateIndicator()

in src/components/ScrollGrid/index.tsx [23:37]


    function updateIndicator() {
      const scroller = scrollerRef.current;
      if (!scroller) return;

      const { scrollWidth, clientWidth } = scroller;
      if (scrollWidth === clientWidth) {
        setShowIndicator(false);
        return;
      }

      const ratio = indicatorWidth / scrollWidth;
      ratioRef.current = ratio;
      setShowIndicator(true);
      setBarWidth(clientWidth * ratio);
    }