feat(docs): add static generation and search indexes
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { createContext, useContext, type ReactNode } from "react"
|
||||
|
||||
const PathnameContext = createContext("/")
|
||||
|
||||
export function PathnameProvider({
|
||||
children,
|
||||
pathname,
|
||||
}: {
|
||||
children: ReactNode
|
||||
pathname: string
|
||||
}) {
|
||||
return (
|
||||
<PathnameContext.Provider value={pathname}>
|
||||
{children}
|
||||
</PathnameContext.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
export function usePathname() {
|
||||
return useContext(PathnameContext)
|
||||
}
|
||||
Reference in New Issue
Block a user