= ({
{getProviderLogo()}
- {providerAlias}
+ {entityAlias}
-
+
diff --git a/components/ui/entities/index.ts b/components/ui/entities/index.ts
new file mode 100644
index 0000000000..70a72f858c
--- /dev/null
+++ b/components/ui/entities/index.ts
@@ -0,0 +1,4 @@
+export * from "./date-with-time";
+export * from "./entity-info-short";
+export * from "./scan-status";
+export * from "./snippet-id";
diff --git a/components/providers/scan-status.tsx b/components/ui/entities/scan-status.tsx
similarity index 100%
rename from components/providers/scan-status.tsx
rename to components/ui/entities/scan-status.tsx
diff --git a/components/providers/snippet-id-provider.tsx b/components/ui/entities/snippet-id.tsx
similarity index 70%
rename from components/providers/snippet-id-provider.tsx
rename to components/ui/entities/snippet-id.tsx
index 0d3c76d566..54b3a4dfa9 100644
--- a/components/providers/snippet-id-provider.tsx
+++ b/components/ui/entities/snippet-id.tsx
@@ -1,16 +1,13 @@
import { Snippet } from "@nextui-org/react";
import React from "react";
-import { CopyIcon, DoneIcon, IdIcon } from "../icons";
+import { CopyIcon, DoneIcon, IdIcon } from "@/components/icons";
-interface SnippetIdProviderProps {
- providerId: string;
+interface SnippetIdProps {
+ entityId: string;
[key: string]: any;
}
-export const SnippetIdProvider: React.FC = ({
- providerId,
- ...props
-}) => {
+export const SnippetId: React.FC = ({ entityId, ...props }) => {
return (
= ({
- {providerId}
+ {entityId}
diff --git a/components/ui/table/status-badge.tsx b/components/ui/table/status-badge.tsx
index e688021cd4..ca8b3e2a49 100644
--- a/components/ui/table/status-badge.tsx
+++ b/components/ui/table/status-badge.tsx
@@ -2,27 +2,23 @@ import { Chip } from "@nextui-org/react";
import React from "react";
type Status =
+ | "available"
+ | "scheduled"
+ | "executing"
| "completed"
- | "pending"
- | "cancelled"
- | "fail"
- | "success"
- | "muted"
- | "active"
- | "inactive";
+ | "failed"
+ | "cancelled";
const statusColorMap: Record<
Status,
"danger" | "warning" | "success" | "default"
> = {
+ available: "default",
+ scheduled: "warning",
+ executing: "default",
completed: "success",
- pending: "warning",
+ failed: "danger",
cancelled: "danger",
- fail: "danger",
- success: "success",
- muted: "default",
- active: "success",
- inactive: "default",
};
export const StatusBadge = ({ status }: { status: Status }) => {
diff --git a/components/users/table/ColumnsUser.tsx b/components/users/table/ColumnsUser.tsx
index 605120c707..20ac2dba9d 100644
--- a/components/users/table/ColumnsUser.tsx
+++ b/components/users/table/ColumnsUser.tsx
@@ -2,8 +2,7 @@
import { ColumnDef } from "@tanstack/react-table";
-import { DateWithTime } from "@/components/providers";
-import { StatusBadge } from "@/components/ui/table";
+import { DateWithTime } from "@/components/ui/entities";
import { UserActions } from "@/components/users";
import { UserProps } from "@/types";
@@ -44,14 +43,7 @@ export const ColumnsUser: ColumnDef[] = [
return ;
},
},
- {
- accessorKey: "status",
- header: "Status",
- cell: ({ row }) => {
- const { status } = getUserData(row);
- return ;
- },
- },
+
{
accessorKey: "actions",
header: () => Actions
,
diff --git a/types/components.ts b/types/components.ts
index 02018469dc..f88967e85e 100644
--- a/types/components.ts
+++ b/types/components.ts
@@ -66,6 +66,47 @@ export interface ProviderProps {
};
}
+export interface ScanProps {
+ type: "Scan";
+ id: string;
+ attributes: {
+ name: string;
+ trigger: "scheduled" | "manual";
+ state:
+ | "available"
+ | "scheduled"
+ | "executing"
+ | "completed"
+ | "failed"
+ | "cancelled";
+ unique_resource_count: number;
+ progress: number;
+ scanner_args: {
+ only_logs?: boolean;
+ excluded_checks?: string[];
+ aws_retries_max_attempts?: number;
+ } | null;
+ duration: number;
+ started_at: string;
+ completed_at: string;
+ scheduled_at: string;
+ };
+ relationships: {
+ provider: {
+ data: {
+ id: string;
+ type: "Provider";
+ };
+ };
+ task: {
+ data: {
+ id: string;
+ type: "Task";
+ };
+ };
+ };
+}
+
export interface FindingProps {
id: string;
attributes: {