mirror of
https://github.com/ConvoyPanel/panel.git
synced 2026-06-11 15:06:02 +08:00
31 lines
686 B
TypeScript
31 lines
686 B
TypeScript
import { ReactNode, useState } from 'react'
|
|
|
|
import {
|
|
NavigationBarContext,
|
|
RouteDefinition,
|
|
} from '@/components/elements/navigation/NavigationBar'
|
|
|
|
interface Props {
|
|
children?: ReactNode
|
|
}
|
|
|
|
const NavigationBarProvider = ({ children }: Props) => {
|
|
const [routes, setRoutes] = useState<RouteDefinition[]>([])
|
|
const [breadcrumb, setBreadcrumb] = useState<string | null | undefined>()
|
|
|
|
const value = {
|
|
routes,
|
|
setRoutes,
|
|
breadcrumb,
|
|
setBreadcrumb,
|
|
}
|
|
|
|
return (
|
|
<NavigationBarContext.Provider value={value}>
|
|
{children}
|
|
</NavigationBarContext.Provider>
|
|
)
|
|
}
|
|
|
|
export default NavigationBarProvider
|