mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
21 lines
568 B
TypeScript
21 lines
568 B
TypeScript
import { useQuery } from '@tanstack/react-query';
|
|
import { useFS } from './useFS';
|
|
import { useFSPaths } from './useFSPaths';
|
|
import { getPluginGitInfo } from '@/lib/plugins';
|
|
|
|
/**
|
|
* Hook to get git info for a specific plugin
|
|
*/
|
|
export function usePluginGitInfo(pluginName: string) {
|
|
const { fs } = useFS();
|
|
const { pluginsPath } = useFSPaths();
|
|
|
|
return useQuery({
|
|
queryKey: ['plugin-git-info', pluginsPath, pluginName],
|
|
queryFn: async () => {
|
|
return await getPluginGitInfo(fs, pluginsPath, pluginName);
|
|
},
|
|
enabled: !!pluginName,
|
|
});
|
|
}
|