UNPKG

644 BJavaScriptView Raw
1"use client";
2
3import * as React from 'react';
4import { SpaceContext } from './context';
5const Item = _ref => {
6 let {
7 className,
8 index,
9 children,
10 split,
11 style
12 } = _ref;
13 const {
14 latestIndex
15 } = React.useContext(SpaceContext);
16 if (children === null || children === undefined) {
17 return null;
18 }
19 return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
20 className: className,
21 style: style
22 }, children), index < latestIndex && split && /*#__PURE__*/React.createElement("span", {
23 className: `${className}-split`
24 }, split));
25};
26export default Item;
\No newline at end of file