a tool for shared writing and social publishing
at debug/datetime 34 lines 729 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 console.log(props); 23 return ( 24 <RequestHeadersContext.Provider 25 value={{ 26 country: props.country, 27 language: props.language, 28 timezone: props.timezone, 29 }} 30 > 31 {props.children} 32 </RequestHeadersContext.Provider> 33 ); 34};