import { PropsWithChildren, createContext, useContext } from 'react'; const Context = createContext(null); Context.displayName = 'PageHeaderContext'; export function useHeaderContext() { const context = useContext(Context); if (context == null) { throw new Error('Should be nested inside a HeaderContainer component'); } } interface Props { id?: string; } export function HeaderContainer({ id, children }: PropsWithChildren) { return (
{children}
); }