hooks.ts 345 B

123456789101112131415
  1. import {
  2. usePluginManifestInfo,
  3. } from '@/service/use-plugins'
  4. export const usePluginInstalledCheck = (providerName = '') => {
  5. const pluginID = providerName?.split('/').splice(0, 2).join('/')
  6. const { data: manifest } = usePluginManifestInfo(pluginID)
  7. return {
  8. inMarketPlace: !!manifest,
  9. manifest: manifest?.data.plugin,
  10. }
  11. }