import { useEffect } from 'react'; export function useScrollIntoView(node: T | null, active: boolean) { useEffect(() => { if (active) { node?.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } }, [active, node]); }