import React, { useCallback } from 'react'; import { apiv3Post } from '~/client/util/apiv3-client'; import { toastSuccess, toastError } from '~/client/util/toastr'; import { useSWRxPlugins } from '~/stores/plugin'; export const PluginInstallerForm = (): JSX.Element => { const { mutate } = useSWRxPlugins(); const submitHandler = useCallback(async(e) => { e.preventDefault(); const formData = e.target.elements; const { 'pluginInstallerForm[url]': { value: url }, // 'pluginInstallerForm[ghBranch]': { value: ghBranch }, // 'pluginInstallerForm[ghTag]': { value: ghTag }, } = formData; const pluginInstallerForm = { url, // ghBranch, // ghTag, }; try { await apiv3Post('/plugins', { pluginInstallerForm }); toastSuccess('Plugin Install Successed!'); } catch (e) { toastError(e); } finally { mutate(); } }, [mutate]); return (

You can install plugins by inputting the GitHub URL.

); };