ant-design/site/theme/template/Content/PrevAndNext.jsx

19 lines
431 B
React
Raw Normal View History

import React from 'react';
2019-08-02 17:59:42 +08:00
const PrevAndNext = ({ prev, next }) => (
<section className="prev-next-nav">
{prev
? React.cloneElement(prev.props.children || prev.children[0], {
className: 'prev-page',
})
: null}
{next
? React.cloneElement(next.props.children || next.children[0], {
className: 'next-page',
})
: null}
</section>
);
2019-08-02 17:59:42 +08:00
export default PrevAndNext;