import { Pagination } from '@megafon/ui-core';
Код DemoPaginationWrapperexport const DemoPaginationWrapper: React.FC<IDemoPaginationWrapperProps> = ({ activePage, children, ...props }) => {const [currentActivePage, setCurrentActivePage] = React.useState(activePage);const childrenProps: childrenPropTypes = {...props,activePage: currentActivePage,onChange: setCurrentActivePage,};return children(childrenProps);};
<DemoPaginationWrapper totalPages={7} activePage={1}> {({ totalPages, activePage, onChange }) => ( <Pagination totalPages={totalPages} activePage={activePage} onChange={onChange} /> )} </DemoPaginationWrapper>
<DemoPaginationWrapper totalPages={7} activePage={4}> {({ totalPages, activePage, onChange }) => ( <Pagination totalPages={totalPages} activePage={activePage} onChange={onChange} /> )} </DemoPaginationWrapper>
<DemoPaginationWrapper totalPages={7} activePage={7}> {({ totalPages, activePage, onChange }) => ( <Pagination totalPages={totalPages} activePage={activePage} onChange={onChange} /> )} </DemoPaginationWrapper>
<DemoPaginationWrapper totalPages={10} activePage={2}> {({ totalPages, activePage, onChange }) => ( <Pagination totalPages={totalPages} activePage={activePage} onChange={onChange} /> )} </DemoPaginationWrapper>
<DemoPaginationWrapper totalPages={10} activePage={6}> {({ totalPages, activePage, onChange }) => ( <Pagination totalPages={totalPages} activePage={activePage} onChange={onChange} /> )} </DemoPaginationWrapper>
<DemoPaginationWrapper totalPages={10} activePage={9}> {({ totalPages, activePage, onChange }) => ( <Pagination totalPages={totalPages} activePage={activePage} onChange={onChange} /> )} </DemoPaginationWrapper>
<div style={{ padding: '30px 0', backgroundColor: '#00B956' }}> <DemoPaginationWrapper totalPages={10} activePage={1} theme="light"> {({ theme, totalPages, activePage, onChange }) => ( <Pagination theme={theme} totalPages={totalPages} activePage={activePage} onChange={onChange} /> )} </DemoPaginationWrapper> </div>