"use client"; import { Loading } from "@/components/dashboard/loading"; import { Button } from "@/components/ui/button"; // 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 { PostHogIdentify } from "@/providers/PostHogProvider"; // import { useUser } from "@clerk/nextjs"; // import { zodResolver } from "@hookform/resolvers/zod"; import { Code2 } from "lucide-react"; import { useRouter } from "next/navigation"; // import { useForm } from "react-hook-form"; import { z } from "zod"; const formSchema = z.object({ name: z.string().min(3, "Name is required and should be at least 3 characters").max(50), }); type Props = { workspace: { id: string; name: string; }; }; export const CreateApi: React.FC = ({ workspace }) => { // const form = useForm>({ // resolver: zodResolver(formSchema), // }); // const { user, isLoaded } = useUser(); // const router = useRouter(); // if (isLoaded && user) { // PostHogIdentify({ user }); // } // const createApi = trpc.api.create.useMutation({ // onSuccess: async ({ id: apiId }) => { // toast.success("Your API has been created"); // router.push(`/new?workspaceId=${workspace.id}&apiId=${apiId}`); // }, // onError(err) { // toast.error(err.message); // }, // }); function AsideContent() { return (

What is an API?

An API groups all of your keys together. They are invisible to your users but allow you to filter keys by a namespace. We recommend creating one API for each environment, typically{" "} development,{" "} preview and{" "} production.

  1. Group keys together
  2. Globally distributed in 35+ locations
  3. Key and API analytics
); } return (
{/*
createApi.mutate({ ...values }))} className="flex flex-col space-y-4" > ( API Name

What should your api be called?

This is just for you, and will not be visible to your customers

)} />
*/}
); };