import { createContext, useContext, type ReactNode } from 'react'; import LightningFS from '@isomorphic-git/lightning-fs'; interface FSContextType { fs: LightningFS.PromisifiedFS; } const FSContext = createContext(undefined); interface FSProviderProps { children: ReactNode; fs: LightningFS.PromisifiedFS; } export function FSProvider({ children, fs }: FSProviderProps) { return ( {children} ); } export function useFS(): FSContextType { const context = useContext(FSContext); if (context === undefined) { throw new Error('useFS must be used within a FSProvider'); } return context; }