⚒️ Create header & layout config.

This commit is contained in:
pheralb
2022-06-21 15:19:13 +01:00
parent 457a6c64f7
commit 4d366f8c25
11 changed files with 188 additions and 137 deletions
+24
View File
@@ -0,0 +1,24 @@
import React from "react";
import useSWR from "swr";
import { getCategorySvgs } from "@/services";
import CustomLink from "@/common/link";
import { Box, Text } from "@chakra-ui/react";
const Categories = () => {
const { data, error } = useSWR(getCategorySvgs);
if (error) return <div>failed to load</div>;
if (!data) return <div>loading...</div>;
return (
<>
{data.map((category: string) => (
<Box key={category} p="4" borderRadius="5px" borderWidth="1px">
<CustomLink href={`/category/${category}`}>{category}</CustomLink>
</Box>
))}
</>
);
};
export default Categories;