import { EmptyPlaceholder } from "@/components/dashboard/empty-placeholder"; // import { getTenantId } from "@/lib/auth"; // import { db } from "@/lib/db"; import { ShieldBan } from "lucide-react"; import Link from "next/link"; import { redirect } from "next/navigation"; // import { UsageBanner } from "./banner"; import { DesktopSidebar } from "./desktop-sidebar"; import { MobileSideBar } from "./mobile-sidebar"; import { TooltipProvider } from "@/components/ui/tooltip"; import service, { UserDataStorageName } from "@/lib/http/service"; interface LayoutProps { children: React.ReactNode; } export default async function Layout({ children }: LayoutProps) { // const tenantId = getTenantId(); // localStorage.getItem(UserDataStorageName); // const workspace = await db.query.workspaces.findFirst({ // where: (table, { and, eq, isNull }) => // and(eq(table.tenantId, tenantId), isNull(table.deletedAt)), // with: { // apis: { // where: (table, { isNull }) => isNull(table.deletedAt), // }, // }, // }); // if (!workspace) { // return redirect("/app/apis"); // } // await service.post('/api/v1/customer/list/staff', { // // email: infoRef.current.email // }, { // headers: { // // 'Authorization': token // } // }).then(function (result: any) { // console.log("result:", result) // if (result && result.header.code != 0) { // // toast.error(result.header.message) // return // } // }).catch((err: any) => { // }); const workspace = { apis: [ { id: "xxxx", name: "1号员工", }, { id: "2222222", name: "2号员工", }, { id: "4444444", name: "3号员工", } ], enabled: true } return ( <>
{/* */}
{workspace.enabled ? ( children ) : (
This workspace is disabled Contact{" "} support@unkey.dev
)}
); }