import { CopyButton } from "@/components/dashboard/copy-button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Code } from "@/components/ui/code"; import { getTenantId } from "@/lib/auth"; // import { db, eq, schema } from "@/lib/db"; import { notFound, redirect } from "next/navigation"; import { DeleteApi } from "./delete-api"; import { UpdateApiName } from "./update-api-name"; import { UpdateIpWhitelist } from "./update-ip-whitelist"; export const dynamic = "force-dynamic"; type Props = { params: { apiId: string; }; }; export default async function SettingsPage(props: Props) { const tenantId = getTenantId(); // const workspace = await db.query.workspaces.findFirst({ // where: (table, { and, eq, isNull }) => // and(eq(table.tenantId, tenantId), isNull(table.deletedAt)), // with: { // apis: { // where: eq(schema.apis.id, props.params.apiId), // }, // }, // }); // if (!workspace || workspace.tenantId !== tenantId) { // return redirect("/new"); // } // const api = workspace.apis.find((api) => api.id === props.params.apiId); // if (!api) { // return notFound(); // } const api = { id: "string", workspaceId: "string", name: "string", ipWhitelist: "string", } return (
{api.id}