Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

useVersion.tsx 398 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
  1. import { useRouter } from 'next/router'
  2. type VersionInfo = {
  3. currentVersion: string
  4. isEnterprise: boolean
  5. }
  6. const DEFAULT_VERSION = 'free-pro-team@latest'
  7. export const useVersion = (): VersionInfo => {
  8. const router = useRouter()
  9. const currentVersion = (router.query.versionId as string) || DEFAULT_VERSION
  10. return { currentVersion, isEnterprise: currentVersion.includes('enterprise') }
  11. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...