diaREact/resources/js/components/pages/List.tsx
2022-02-11 17:26:15 +01:00

30 lines
787 B
TypeScript

import {Grid, List, Pagination} from '@mui/material';
import * as React from 'react';
import Page from "./Page";
interface List {
id: string;
date: string;
}
export default function Pages({pages, url, removeUrl, csrf, passphrase, setPassphrase}) {
const isPassphraseSet = passphrase !== null;
let listPages = pages.map(page =>
<Page page={page} url={url} setPassphrase={setPassphrase} passphrase={passphrase} csrf={csrf} removeUrl={removeUrl} />
)
if (isPassphraseSet) {
return (
<div>
<Grid container rowSpacing={1} columnSpacing={1}>
{listPages}
</Grid>
<Pagination count={10} color="primary" />
</div>
);
}
return (<div></div>);
}