index.tsx 472 B

12345678910111213141516171819202122
  1. 'use client'
  2. import { useRef } from 'react'
  3. import { useScrollIntersection } from './hooks'
  4. type IntersectionLineProps = {
  5. intersectionContainerId?: string
  6. }
  7. const IntersectionLine = ({
  8. intersectionContainerId,
  9. }: IntersectionLineProps) => {
  10. const ref = useRef<HTMLDivElement>(null)
  11. useScrollIntersection(ref, intersectionContainerId)
  12. return (
  13. <div ref={ref} className='shrink-0 mb-4 h-[1px] bg-transparent'></div>
  14. )
  15. }
  16. export default IntersectionLine