'use client'
import React, { ReactNode, useContext } from 'react';
import { createContext } from 'react';
import { personalData } from '../../PersonalData';
import { PersonalData } from '../../PersonalDataTypes';

export const PersonContext = createContext(personalData);

export function PersonProvider(props: { children: ReactNode }) {
    return (
        <PersonContext.Provider value={personalData}>
            {props.children}
        </PersonContext.Provider>
    )
}

export const usePersonContext = (): PersonalData => useContext(PersonContext)
