diff --git a/components/providers/CheckConnectionProvider.tsx b/components/providers/CheckConnectionProvider.tsx deleted file mode 100644 index d5bc9e727d..0000000000 --- a/components/providers/CheckConnectionProvider.tsx +++ /dev/null @@ -1,42 +0,0 @@ -"use client"; - -import { useRef } from "react"; - -import { checkConnectionProvider } from "@/actions/providers"; - -import { CustomButtonClientAction } from "../ui/custom"; -import { useToast } from "../ui/toast"; - -export const CheckConnectionProvider = ({ id }: { id: string }) => { - const ref = useRef(null); - const { toast } = useToast(); - - async function clientAction(formData: FormData) { - // reset the form - ref.current?.reset(); - // client-side validation - const data = await checkConnectionProvider(formData); - if (data?.errors && data.errors.length > 0) { - const error = data.errors[0]; - const errorMessage = `${error.detail}`; - // show error - toast({ - variant: "destructive", - title: "Oops! Something went wrong", - description: errorMessage, - }); - } else { - toast({ - title: "Checking", - description: "The task was launched successfully", - }); - } - } - - return ( -
- - - - ); -}; diff --git a/components/providers/index.ts b/components/providers/index.ts index 5093cbf0ac..6fb3bcae31 100644 --- a/components/providers/index.ts +++ b/components/providers/index.ts @@ -1,5 +1,4 @@ export * from "./add-provider"; -export * from "./CheckConnectionProvider"; export * from "./forms/delete-form"; export * from "./provider-info"; export * from "./radio-group-provider"; diff --git a/components/providers/table/data-table-row-actions.tsx b/components/providers/table/data-table-row-actions.tsx index 35f14d395c..127e829c4a 100644 --- a/components/providers/table/data-table-row-actions.tsx +++ b/components/providers/table/data-table-row-actions.tsx @@ -20,7 +20,6 @@ import { useState } from "react"; import { VerticalDotsIcon } from "@/components/icons"; import { CustomAlertModal } from "@/components/ui/custom"; -import { CheckConnectionProvider } from "../CheckConnectionProvider"; import { EditForm } from "../forms"; import { DeleteForm } from "../forms/delete-form"; @@ -80,7 +79,7 @@ export function DataTableRowActions({ textValue="Check Connection" startContent={} > - + {/* TODO: add the provider type to the search params */}