dify/web/app/components/plugins/marketplace/intersection-line/index.tsx

28 lines
567 B
TypeScript
Raw Normal View History

2024-10-12 12:46:29 +08:00
'use client'
import { useRef } from 'react'
import { useScrollIntersection } from './hooks'
2024-10-12 16:34:02 +08:00
type IntersectionLineProps = {
containerRef: React.RefObject<HTMLDivElement>
intersectedCallback: (isIntersecting: boolean) => void
}
const IntersectionLine = ({
containerRef,
intersectedCallback,
}: IntersectionLineProps) => {
2024-10-12 12:46:29 +08:00
const ref = useRef<HTMLDivElement>(null)
2024-10-12 16:34:02 +08:00
useScrollIntersection(
containerRef,
ref,
intersectedCallback,
)
2024-10-12 12:46:29 +08:00
return (
<div ref={ref} className='h-[1px] bg-transparent'></div>
)
}
export default IntersectionLine