David Prince
fix: add all missing local module stubs (remote_mcp_registry, mcp_auth, mcp_transport, etc)
cce8120
Raw
History Blame Contribute Delete
867 Bytes
"use client";
import {useState} from "react";
import * as github from "../services/github/client";
export default function useGitHub(){
const [loading,setLoading]=useState(false);
async function execute(fn,...args){
setLoading(true);
try{
return await fn(...args);
}finally{
setLoading(false);
}
}
return{
loading,
repositories:(...a)=>execute(github.repositories,...a),
repository:(...a)=>execute(github.repository,...a),
cloneRepository:(...a)=>execute(github.cloneRepository,...a),
createRepository:(...a)=>execute(github.createRepository,...a),
commit:(...a)=>execute(github.commit,...a),
push:(...a)=>execute(github.push,...a),
pull:(...a)=>execute(github.pull,...a),
branches:(...a)=>execute(github.branches,...a),
checkout:(...a)=>execute(github.checkout,...a),
pullRequests:(...a)=>execute(github.pullRequests,...a)
};
}