a tool for shared writing and social publishing
at fix/bottom-scroll-margin-on-docs 29 lines 676 B view raw
1"use client"; 2import { createContext } from "react"; 3 4export type RequestHeaders = { 5 country: string | null; 6 language: string | null; 7 timezone: string | null; 8}; 9 10export const RequestHeadersContext = createContext<RequestHeaders>({ 11 country: null, 12 language: null, 13 timezone: null, 14}); 15 16export const RequestHeadersProvider = (props: { 17 country: string | null; 18 language: string | null; 19 timezone: string | null; 20 children: React.ReactNode; 21}) => { 22 return ( 23 <RequestHeadersContext.Provider 24 value={{ country: props.country, language: props.language, timezone: props.timezone }} 25 > 26 {props.children} 27 </RequestHeadersContext.Provider> 28 ); 29};