"use client"; import { Loading } from "@/components/dashboard/loading"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogFooter, DialogTrigger } from "@/components/ui/dialog"; // import { // Form, // FormControl, // FormDescription, // FormField, // FormItem, // FormLabel, // FormMessage, // } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { toast } from "@/components/ui/toaster"; // import { trpc } from "@/lib/trpc/client"; // import { zodResolver } from "@hookform/resolvers/zod"; import { Plus } from "lucide-react"; import { useRouter } from "next/navigation"; import React from "react"; // import { useForm } from "react-hook-form"; import { z } from "zod"; const formSchema = z.object({ name: z.string().min(2).max(50), }); export const CreateApiButton = ({ ...rest }: React.ButtonHTMLAttributes) => { // const form = useForm>({ // resolver: zodResolver(formSchema), // }); // const create = trpc.api.create.useMutation({ // onSuccess(res) { // toast.success("Your API has been created"); // router.refresh(); // router.push(`/app/apis/${res.id}`); // }, // onError(err) { // console.error(err); // toast.error(err.message); // }, // }); async function onSubmit(values: z.infer) { // create.mutate(values); } const router = useRouter(); return ( <> {/*
( Name This is just a human readable name for you and not visible to anyone else )} /> */}
); };