Files
sanasto-app/pages/lists/[listId].js
2020-12-30 17:08:19 -06:00

23 lines
501 B
JavaScript

import AppShell from '../../components/AppShell';
import ListDetailPage from '../../components/pages/ListDetail';
import { lists } from '../../mock';
export default function ListDetail({ list }) {
return <AppShell page={ListDetailPage} pageProps={{ list }} />;
}
export const getServerSideProps = context => {
const {
params: { listId },
} = context;
const list = lists.find(l => l.id === listId);
console.log('Loaded list', list);
return {
props: {
list,
},
};
};