Raw
1 "use client"
2
3 import React from "react"
4 import { SidebarChild } from "../Child"
5 import { SidebarTopMobileClose } from "./MobileClose"
6 import { useSidebar } from "@/providers/Sidebar"
7 import { DottedSeparator } from "@/components/DottedSeparator"
8 import clsx from "clsx"
9
10 export const SidebarTop = React.forwardRef<HTMLDivElement>(
11 function SidebarTop(props, ref) {
12 const { sidebarHistory } = useSidebar()
13
14 return (
15 <div
16 className={clsx(
17 "pt-docs_0.25 sticky top-0 z-[5]",
18 "bg-medusa-bg-base lg:bg-medusa-bg-subtle"
19 )}
20 ref={ref}
21 >
22 <SidebarTopMobileClose />
23 <div>
24 {sidebarHistory.length > 1 && (
25 <>
26 <SidebarChild />
27 <DottedSeparator wrapperClassName="!my-0" />
28 </>
29 )}
30 </div>
31 </div>
32 )
33 }
34 )