import React, { ReactNode } from 'react'; import { useProfile } from 'hooks/profile'; import { MessageFragment, MyProfileFragment } from 'expo-schema'; export const ProfileContext = React.createContext({ profile: undefined, drafts: [], removeDraft: () => {}, refetchDrafts: () => {}, }); export const ProfileProvider: React.FC = ({ children }) => { const { profile, drafts, removeDraft, refetchDrafts } = useProfile(); return ( {children} ); }; export interface ProfileContextType { profile: MyProfileFragment | undefined | null; drafts: MessageFragment[]; removeDraft: (draftId: string) => void; refetchDrafts: () => void; } interface ProfileProps { children?: ReactNode; }