"use client"; import { Button, Input } from "@nextui-org/react"; import { useRef, useState } from "react"; import { addProvider } from "@/actions"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, useToast, } from "@/components/ui"; import { ButtonAddProvider } from "./ButtonAddProvider"; import { CustomRadioProvider } from "./CustomRadioProvider"; export const AddProviderModal = () => { const [open, setOpen] = useState(false); const ref = useRef(null); const { toast } = useToast(); async function clientAction(formData: FormData) { // reset the form ref.current?.reset(); // client-side validation const data = await addProvider(formData); if (data?.errors) { data.errors.forEach((error: { detail: string }) => { const errorMessage = `${error.detail}`; // show error toast({ variant: "destructive", title: "Ups! Something went wrong", description: errorMessage, }); }); } else { toast({ title: "Success!", description: "The provider was added successfully.", }); } } return ( Add cloud account You must manually deploy a new read-only IAM role for each account you want to add. The following links will provide detailed instructions how to do this:
setOpen(false)} className="grid sm:grid-cols-2 gap-6" >
); };