import CreateBeerPostForm from '@/components/CreateBeerPostForm'; import FormPageLayout from '@/components/ui/forms/FormPageLayout'; import Layout from '@/components/ui/Layout'; import withPageAuthRequired from '@/getServerSideProps/withPageAuthRequired'; import DBClient from '@/prisma/DBClient'; import getAllBreweryPosts from '@/services/BreweryPost/getAllBreweryPosts'; import BreweryPostQueryResult from '@/services/BreweryPost/types/BreweryPostQueryResult'; import { BeerType } from '@prisma/client'; import { NextPage } from 'next'; import { BiBeer } from 'react-icons/bi'; import { z } from 'zod'; interface CreateBeerPageProps { breweries: z.infer[]; types: BeerType[]; } const Create: NextPage = ({ breweries, types }) => { return ( ); }; export const getServerSideProps = withPageAuthRequired(async () => { const breweryPosts = await getAllBreweryPosts(); const beerTypes = await DBClient.instance.beerType.findMany(); return { props: { breweries: JSON.parse(JSON.stringify(breweryPosts)), types: JSON.parse(JSON.stringify(beerTypes)), }, }; }); export default Create;