Add unified git sync state so state is shared across components

This commit is contained in:
Alex Gleason committed 2025-12-29 16:10:09 -06:00
1 parent 758e3ab261
commit 1e13ed8f36
7 files changed
+160 -43

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { createContext } from 'react';
export type GitOperation = 'fetch' | 'pull' | 'push';
export interface GitSyncState {
dir: string;
operation: GitOperation;
isActive: boolean;
}
export interface GitSyncContextValue {
syncStates: Map<string, GitSyncState>;
startOperation: (dir: string, operation: GitOperation) => void;
endOperation: (dir: string) => void;
getState: (dir: string) => GitSyncState | undefined;
}
export const GitSyncContext = createContext<GitSyncContextValue | null>(null);