import classNames from 'classnames'; import { useAtomValue } from 'jotai'; import { memo } from 'react'; import { hoveredParentDepthFamily, isAncestorHoveredFamily } from './atoms'; export const TreeIndentGuide = memo(function TreeIndentGuide({ treeId, depth, ancestorIds, }: { treeId: string; depth: number; ancestorIds: string[]; }) { const parentDepth = useAtomValue(hoveredParentDepthFamily(treeId)); const isHovered = useAtomValue(isAncestorHoveredFamily({ treeId, ancestorIds })); return (
{Array.from({ length: depth }).map((_, i) => (
))}
); });