diff --git a/app/clouds/page.tsx b/app/clouds/page.tsx index 878d778ed4..a6f35d6e16 100644 --- a/app/clouds/page.tsx +++ b/app/clouds/page.tsx @@ -22,72 +22,6 @@ import { PencilSquareIcon } from "@heroicons/react/24/solid"; import { TrashIcon } from "@heroicons/react/24/solid"; import { EyeIcon } from "@heroicons/react/24/solid"; -const statusColorMap = { - active: "success", - paused: "danger", - vacation: "warning", -}; - -const columns = [ - { name: "NAME", uid: "name" }, - { name: "ROLE", uid: "role" }, - { name: "STATUS", uid: "status" }, - { name: "ACTIONS", uid: "actions" }, -]; - -const users = [ - { - id: 1, - name: "Tony Reichert", - role: "CEO", - team: "Management", - status: "active", - age: "29", - avatar: "https://i.pravatar.cc/150?u=a042581f4e29026024d", - email: "tony.reichert@example.com", - }, - { - id: 2, - name: "Zoey Lang", - role: "Technical Lead", - team: "Development", - status: "paused", - age: "25", - avatar: "https://i.pravatar.cc/150?u=a042581f4e29026704d", - email: "zoey.lang@example.com", - }, - { - id: 3, - name: "Jane Fisher", - role: "Senior Developer", - team: "Development", - status: "active", - age: "22", - avatar: "https://i.pravatar.cc/150?u=a04258114e29026702d", - email: "jane.fisher@example.com", - }, - { - id: 4, - name: "William Howard", - role: "Community Manager", - team: "Marketing", - status: "vacation", - age: "28", - avatar: "https://i.pravatar.cc/150?u=a048581f4e29026701d", - email: "william.howard@example.com", - }, - { - id: 5, - name: "Kristen Copper", - role: "Sales Manager", - team: "Sales", - status: "active", - age: "24", - avatar: "https://i.pravatar.cc/150?u=a092581d4ef9026700d", - email: "kristen.cooper@example.com", - }, -]; - export default function CloudsPage() { const getAccounts = useSWR( `http://localhost:8080/api/v1/providers/aws/accounts`, @@ -114,7 +48,7 @@ export default function CloudsPage() { } if (detail === "added") { - return new Date(scan?.inserted_at).toString(); + return new Date(scan?.inserted_at).toDateString(); } return; @@ -126,10 +60,10 @@ export default function CloudsPage() { // TODO FIX TYPE CHECKING const rowItems = getAccounts.data?.map((row: any) => ( - {row.account_id} + {row.aws_account_id} {row.provider_id} - TBD - TBD + {row.alias} + {row.connected && "Connected"} {row.groups.map(String).join(", ")} {getScanDetails(row.account_id, "status")} {getScanDetails(row.account_id, "duration")} @@ -139,126 +73,7 @@ export default function CloudsPage() { )); - // console.log("### rows", rows); - - // const rows = data; - - // const rows = [ - // { - // key: "1", - // name: "Tony Reichert", - // role: "CEO", - // status: "Active", - // }, - // { - // key: "2", - // name: "Zoey Lang", - // role: "Technical Lead", - // status: "Paused", - // }, - // { - // key: "3", - // name: "Jane Fisher", - // role: "Senior Developer", - // status: "Active", - // }, - // { - // key: "4", - // name: "William Howard", - // role: "Community Manager", - // status: "Vacation", - // }, - // ]; - - // const columns = [ - // { - // key: "provider_id", - // label: "Account", - // }, - // { - // key: "groups", - // label: "Group(s)", - // }, - // { - // key: "status", - // label: "Scan Status", - // }, - // { - // key: "lastScan", - // label: "Last Scan", - // }, - // { - // key: "nextScan", - // label: "Next Scan", - // }, - // { - // key: "resources", - // label: "Resources", - // }, - // { - // key: "added", - // label: "Added", - // }, - // ]; - - const renderCell = React.useCallback((user, columnKey) => { - const cellValue = user[columnKey]; - - switch (columnKey) { - case "name": - return ( - - {user.email} - - ); - case "role": - return ( -
-

{cellValue}

-

- {user.team} -

-
- ); - case "status": - return ( - - {cellValue} - - ); - case "actions": - return ( -
- - - - - - - - - - - - - - - -
- ); - default: - return cellValue; - } - }, []); + // TODO IMPLEMENT NEXT UI SPECIFIC TABLE COMPONENT WITH VARIED RENDERING return (
@@ -287,32 +102,6 @@ export default function CloudsPage() { {rowItems} - - // - // - // {(column) => ( - // - // {column.name} - // - // )} - // - // - // {(item) => ( - // - // {(columnKey) => ( - // {renderCell(item, columnKey)} - // )} - // - // )} - // - //
)}

This is a page with "use client", useSWR