import { initTRPC } from '@trpc/server';
import superjson from 'superjson';

// Create a tRPC instance
export const t = initTRPC.create({
  transformer: superjson,
});

// Export types
export type Context = {};

// Create router and procedure helpers
export const router = t.router;
export const publicProcedure = t.procedure;
export const protectedProcedure = t.procedure;

// Main AppRouter
export const AppRouter = {
  waitlistRouter: waitlistRouter,
} as const;

type AppRouterOutput = typeof AppRouter;

// Re-export for use in components
export type { Context, AppRouterOutput };

// Import and attach waitlistRouter
import { waitlistRouter } from './waitlist-router';
