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
failed to load
; if (!data) return
loading...
; return ( <> {data.map((category: string) => ( {category} ))} ); }; export default Categories;