David Prince
fix: add all missing local module stubs (remote_mcp_registry, mcp_auth, mcp_transport, etc)
cce8120
Raw
History Blame Contribute Delete
771 Bytes
"use client";
import {useState} from "react";
import templates from "../services/templates/client";
export default function useTemplates(){
const [loading,setLoading]=useState(false);
async function exec(fn,...args){
setLoading(true);
try{
const {data}=await fn(...args);
return data;
}finally{
setLoading(false);
}
}
return{
loading,
list:(...a)=>exec(templates.list,...a),
categories:(...a)=>exec(templates.categories,...a),
featured:(...a)=>exec(templates.featured,...a),
load:(...a)=>exec(templates.load,...a),
create:(...a)=>exec(templates.create,...a),
update:(...a)=>exec(templates.update,...a),
remove:(...a)=>exec(templates.remove,...a),
duplicate:(...a)=>exec(templates.duplicate,...a),
publish:(...a)=>exec(templates.publish,...a)
};
}