mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-30 15:24:22 +00:00
fix: run the lint fix to be able to build the app
This commit is contained in:
3 files changed
+123
-109
No files matched your search
@@ -1,22 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import { addProvider } from "@/actions";
|
||||
import { useRef } from "react";
|
||||
|
||||
import { addProvider } from "@/actions";
|
||||
|
||||
import { useToast } from "../ui/toast";
|
||||
import { ButtonAddProvider } from "./ButtonAddProvider";
|
||||
|
||||
export const AddProvider = () => {
|
||||
const ref = useRef<HTMLFormElement>(null)
|
||||
const { toast } = useToast()
|
||||
|
||||
async function clientAction(formData:FormData) {
|
||||
const ref = useRef<HTMLFormElement>(null);
|
||||
const { toast } = useToast();
|
||||
|
||||
async function clientAction(formData: FormData) {
|
||||
// reset the form
|
||||
ref.current?.reset();
|
||||
// client-side validation
|
||||
const data = await addProvider(formData)
|
||||
const data = await addProvider(formData);
|
||||
if (data?.errors) {
|
||||
data.errors.forEach((error: { detail: string }) => {
|
||||
let errorMessage = `${error.detail}`;
|
||||
const errorMessage = `${error.detail}`;
|
||||
// show error
|
||||
toast({
|
||||
title: "Wops! Something went wrong",
|
||||
|
||||
@@ -14,12 +14,12 @@ import { VerticalDotsIcon } from "@/components/icons";
|
||||
import { StatusBadge } from "@/components/ui/table/StatusBadge";
|
||||
import { ProviderProps } from "@/types";
|
||||
|
||||
import { DateWithTime } from "../DateWithTime";
|
||||
import { ProviderInfo } from "../ProviderInfo";
|
||||
import { DeleteProvider } from "../DeleteProvider";
|
||||
import { CheckConnectionProvider } from "../CheckConnectionProvider";
|
||||
import { DateWithTime } from "../DateWithTime";
|
||||
import { DeleteProvider } from "../DeleteProvider";
|
||||
import { ProviderInfo } from "../ProviderInfo";
|
||||
|
||||
const getProviderData= (row: { original: ProviderProps }) => {
|
||||
const getProviderData = (row: { original: ProviderProps }) => {
|
||||
return row.original;
|
||||
};
|
||||
|
||||
@@ -32,7 +32,9 @@ export const ColumnsProviders: ColumnDef<ProviderProps>[] = [
|
||||
accessorKey: "account",
|
||||
header: "Account",
|
||||
cell: ({ row }) => {
|
||||
const { attributes: { connection, provider, alias, provider_id } } = getProviderData(row);
|
||||
const {
|
||||
attributes: { connection, provider, alias, provider_id },
|
||||
} = getProviderData(row);
|
||||
return (
|
||||
<ProviderInfo
|
||||
connected={connection.connected}
|
||||
@@ -55,7 +57,9 @@ export const ColumnsProviders: ColumnDef<ProviderProps>[] = [
|
||||
accessorKey: "lastScan",
|
||||
header: "Last Scan",
|
||||
cell: ({ row }) => {
|
||||
const { attributes: {updated_at} } = getProviderData(row);
|
||||
const {
|
||||
attributes: { updated_at },
|
||||
} = getProviderData(row);
|
||||
return <DateWithTime dateTime={updated_at} />;
|
||||
},
|
||||
},
|
||||
@@ -63,7 +67,9 @@ export const ColumnsProviders: ColumnDef<ProviderProps>[] = [
|
||||
accessorKey: "nextScan",
|
||||
header: "Next Scan",
|
||||
cell: ({ row }) => {
|
||||
const { attributes: {updated_at} } = getProviderData(row);
|
||||
const {
|
||||
attributes: { updated_at },
|
||||
} = getProviderData(row);
|
||||
const nextDay = add(new Date(updated_at), {
|
||||
hours: 24,
|
||||
});
|
||||
@@ -82,7 +88,9 @@ export const ColumnsProviders: ColumnDef<ProviderProps>[] = [
|
||||
accessorKey: "added",
|
||||
header: "Added",
|
||||
cell: ({ row }) => {
|
||||
const { attributes: {inserted_at} } = getProviderData(row);
|
||||
const {
|
||||
attributes: { inserted_at },
|
||||
} = getProviderData(row);
|
||||
return <DateWithTime dateTime={inserted_at} showTime={false} />;
|
||||
},
|
||||
},
|
||||
@@ -101,7 +109,9 @@ export const ColumnsProviders: ColumnDef<ProviderProps>[] = [
|
||||
</Button>
|
||||
</DropdownTrigger>
|
||||
<DropdownMenu>
|
||||
<DropdownItem><CheckConnectionProvider id={id} /></DropdownItem>
|
||||
<DropdownItem>
|
||||
<CheckConnectionProvider id={id} />
|
||||
</DropdownItem>
|
||||
<DropdownItem>
|
||||
<DeleteProvider id={id} />
|
||||
</DropdownItem>
|
||||
|
||||
Reference in new issue
Block a user