()
| 225 | |
| 226 | // Check scroll buttons visibility |
| 227 | const checkScrollButtons = () => { |
| 228 | const container = scrollContainerRef.current; |
| 229 | if (!container) return; |
| 230 | |
| 231 | const { scrollLeft, scrollWidth, clientWidth } = container; |
| 232 | setShowLeftScroll(scrollLeft > 0); |
| 233 | setShowRightScroll(scrollLeft + clientWidth < scrollWidth - 1); |
| 234 | }; |
| 235 | |
| 236 | useEffect(() => { |
| 237 | checkScrollButtons(); |