Files
medusa-store/www/apps/api-reference/components/VersionSwitcher/index.tsx
Shahed Nasser 5634a4762b docs: improve AI Assistant (#11208)
* 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
2025-01-29 19:13:51 +02:00

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