import { ref, onMounted } from 'vue'

export default () => {
    const plugins = ref([])

    onMounted(async () => {
        plugins.value = await window.api.listPlugins()
    })

    const setActivePlugin = async (pluginId) => {
        await window.api.setActivePlugin(pluginId)
    }

    return {
        plugins,
        setActivePlugin,
    }
}
