* initial implementation * integrate new ai assistant in other projects + ux improvements * fix chat window on mobile devices * fixes to mobile * allow pre * change shortcut to i * improved responsiveness * align version in navbar
25 lines
597 B
TypeScript
25 lines
597 B
TypeScript
"use client"
|
|
|
|
import { Toggle } from "docs-ui"
|
|
import clsx from "clsx"
|
|
import { usePathname } from "next/navigation"
|
|
|
|
const VersionSwitcher = () => {
|
|
const pathname = usePathname()
|
|
|
|
return (
|
|
<div className="flex gap-0.5 justify-center items-center">
|
|
<span className={clsx("text-medusa-fg-disabled")}>V1</span>
|
|
<Toggle
|
|
checked={true}
|
|
onCheckedChange={() => {
|
|
location.href = process.env.NEXT_PUBLIC_API_V1_URL + pathname
|
|
}}
|
|
/>
|
|
<span className={clsx("text-medusa-fg-base")}>V2</span>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default VersionSwitcher
|