mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-07-09 10:31:46 +08:00
28 lines
567 B
TypeScript
28 lines
567 B
TypeScript
'use client'
|
|
|
|
import { useRef } from 'react'
|
|
import { useScrollIntersection } from './hooks'
|
|
|
|
type IntersectionLineProps = {
|
|
containerRef: React.RefObject<HTMLDivElement>
|
|
intersectedCallback: (isIntersecting: boolean) => void
|
|
}
|
|
const IntersectionLine = ({
|
|
containerRef,
|
|
intersectedCallback,
|
|
}: IntersectionLineProps) => {
|
|
const ref = useRef<HTMLDivElement>(null)
|
|
|
|
useScrollIntersection(
|
|
containerRef,
|
|
ref,
|
|
intersectedCallback,
|
|
)
|
|
|
|
return (
|
|
<div ref={ref} className='h-[1px] bg-transparent'></div>
|
|
)
|
|
}
|
|
|
|
export default IntersectionLine
|