add api generator

This commit is contained in:
Johannes Kirschbauer
2023-08-25 13:40:52 +02:00
parent fb1376b23d
commit 5a39865622
13 changed files with 9247 additions and 20 deletions

View File

@@ -19,6 +19,7 @@ import { Sidebar } from "@/components/sidebar";
import MenuIcon from "@mui/icons-material/Menu";
import Image from "next/image";
import { tw } from "@/utils/tailwind";
import axios from "axios";
const roboto = localFont({
src: [
@@ -30,6 +31,8 @@ const roboto = localFont({
],
});
axios.defaults.baseURL = "http://localhost:2979";
// add negative margin for smooth transition to fill the space of the sidebar
const translate = tw`lg:-ml-64 -ml-14`;

View File

@@ -29,6 +29,7 @@ import {
Typography,
} from "@mui/material";
import { useState } from "react";
import { useListMachines } from "../../../../api/default/default";
export async function generateStaticParams() {
return [{ id: "1" }, { id: "2" }];
@@ -46,6 +47,8 @@ interface TemplateDetailProps {
params: { id: string };
}
export default function TemplateDetail({ params }: TemplateDetailProps) {
const { data, isLoading } = useListMachines();
console.log({ data, isLoading });
const details = getTemplate(params);
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);