import Head from 'next/head' import CategoryCard from '~/components/categoryCard' import styles from './category/style.module.css' Categories.getInitialProps = async ({ctx}) => { const {data: categories} = await ctx.axios.get('/api/categories') return {categories} } export default function Categories({categories: allCategories}) { const topCategories = allCategories.filter(cat => !cat.parent) return ( <> Categories | Society of Socks

Categories

{topCategories.length > 0 &&
{topCategories.map(category => ( ))}
} ) }