69 lines
1.8 KiB
TypeScript
69 lines
1.8 KiB
TypeScript
import { CopyButton } from "@/components/dashboard/copy-button";
|
|
import { CreateKeyButton } from "@/components/dashboard/create-key-button";
|
|
import { Navbar } from "@/components/dashboard/navbar";
|
|
import { PageHeader } from "@/components/dashboard/page-header";
|
|
import { Badge } from "@/components/ui/badge";
|
|
// import { getTenantId } from "@/lib/auth";
|
|
// import { db } from "@/lib/db";
|
|
import { notFound } from "next/navigation";
|
|
import { PropsWithChildren } from "react";
|
|
|
|
type Props = PropsWithChildren<{
|
|
params: {
|
|
apiId: string;
|
|
};
|
|
}>;
|
|
|
|
export const dynamic = "force-dynamic";
|
|
export const runtime = "edge";
|
|
|
|
export default async function ApiPageLayout(props: Props) {
|
|
// const tenantId = getTenantId();
|
|
|
|
// const api = await db.query.apis.findFirst({
|
|
// where: (table, { eq, and, isNull }) =>
|
|
// and(eq(table.id, props.params.apiId), isNull(table.deletedAt)),
|
|
// with: {
|
|
// workspace: true,
|
|
// },
|
|
// });
|
|
// if (!api || api.workspace.tenantId !== tenantId) {
|
|
// return notFound();
|
|
// }
|
|
|
|
const api = {
|
|
id: "abcfdds"
|
|
}
|
|
const navigation = [
|
|
{
|
|
label: "概述",
|
|
href: `/manage/staffs/${api.id}`,
|
|
segment: null,
|
|
},
|
|
// {
|
|
// label: "Keys",
|
|
// href: `/manage/keys/${api.keyAuthId}`,
|
|
// segment: "keys",
|
|
// },
|
|
{
|
|
label: "设置",
|
|
href: `/manage/staffs/${api.id}/settings`,
|
|
segment: "settings",
|
|
},
|
|
];
|
|
|
|
let URL = `${process.env.NEXT_PUBLIC_CLIENT_BASE_WS}/staffai/${props.params.apiId}`
|
|
// if (typeof window !== 'undefined') {
|
|
// URL = `${window.location.origin}/staffai/${props.params.apiId}`
|
|
// }
|
|
|
|
return (
|
|
<div>
|
|
|
|
<Navbar navigation={navigation} className="z-20" />
|
|
|
|
<main className="relative mt-8 mb-20 ">{props.children}</main>
|
|
</div>
|
|
);
|
|
}
|