import * as React from 'react'; import { SpaceContext } from './context'; import type { SpaceContextType } from './context'; export interface ItemProps { className: string; children: React.ReactNode; index: number; split?: React.ReactNode; style?: React.CSSProperties; } const Item: React.FC = ({ className, index, children, split, style }) => { const { latestIndex } = React.useContext(SpaceContext); if (children === null || children === undefined) { return null; } return ( <>
{children}
{index < latestIndex && split && {split}} ); }; export default Item;