import { Repo } from '@/types/repo'; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { useForm, usePage } from '@inertiajs/react'; import { useState } from 'react'; import { DownloadIcon, LoaderCircleIcon } from 'lucide-react'; import { Form, FormField, FormFields } from '@/components/ui/form'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { Label } from '@/components/ui/label'; import { Input } from '@/components/ui/input'; import InputError from '@/components/ui/input-error'; import { Plugin } from '@/types/plugin'; export default function Install({ repo }: { repo?: Repo }) { const [open, setOpen] = useState(false); const page = usePage<{ plugins: Plugin[]; }>(); const form = useForm({ url: repo?.html_url || '', }); const submit = () => { form.post(route('plugins.install'), { onSuccess: () => { form.reset(); setOpen(false); }, }); }; return ( Install plugin Install plugin {repo?.full_name}
{repo ? (

Are you sure you want to install the plugin{' '} {repo.full_name} ? This will clone the repository and set it up as a Vito plugin.

) : (

You can use this form to install a plugin or use the following command on your Vito instance

                      php artisan plugins:install <repository-url>
                    
form.setData('url', e.target.value)} />
)}
); }