Next.js state management and dynamic routes - Theo's Typesafe Cult