'use server' import { db } from "@/database/db"; import { currentUser } from "@clerk/nextjs/server"; export const createContext = async () => { let user = null if (typeof window !== 'undefined') { user = await currentUser() } return { db, user: { userId: user?.id as string, rol: user?.publicMetadata?.role as any, }, }; }; export type Context = Awaited>;