mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
#591 - server-providers
This commit is contained in:
@ -10,14 +10,14 @@ import {
|
||||
} from '@/components/ui/dialog';
|
||||
import { FormEventHandler, ReactNode, useState } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { CheckIcon, LoaderCircle } from 'lucide-react';
|
||||
import { LoaderCircle } from 'lucide-react';
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { Form, FormField, FormFields } from '@/components/ui/form';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import InputError from '@/components/ui/input-error';
|
||||
import { Project } from '@/types/project';
|
||||
import { Transition } from '@headlessui/react';
|
||||
import FormSuccessful from '@/components/form-successful';
|
||||
|
||||
export default function ProjectForm({ project, children }: { project?: Project; children: ReactNode }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
@ -58,16 +58,7 @@ export default function ProjectForm({ project, children }: { project?: Project;
|
||||
</FormField>
|
||||
</FormFields>
|
||||
</Form>
|
||||
<DialogFooter className="items-center">
|
||||
<Transition
|
||||
show={form.recentlySuccessful}
|
||||
enter="transition ease-in-out"
|
||||
enterFrom="opacity-0"
|
||||
leave="transition ease-in-out"
|
||||
leaveTo="opacity-0"
|
||||
>
|
||||
<CheckIcon className="text-success" />
|
||||
</Transition>
|
||||
<DialogFooter>
|
||||
<DialogClose asChild>
|
||||
<Button type="button" variant="outline">
|
||||
Cancel
|
||||
@ -75,6 +66,7 @@ export default function ProjectForm({ project, children }: { project?: Project;
|
||||
</DialogClose>
|
||||
<Button form="project-form" type="button" onClick={submit} disabled={form.processing}>
|
||||
{form.processing && <LoaderCircle className="animate-spin" />}
|
||||
<FormSuccessful successful={form.recentlySuccessful} />
|
||||
Save
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
Reference in New Issue
Block a user