From 721aea945aaff53f17f06da216a9ecde190fed8c Mon Sep 17 00:00:00 2001 From: Sophia Dao Date: Sun, 7 Jul 2024 09:56:54 -0500 Subject: [PATCH] chore: clean up due to linter rules --- app/about/layout.tsx | 10 +--- app/blog/layout.tsx | 10 +--- app/clouds/layout.tsx | 6 +-- app/clouds/page.tsx | 53 ++++++++------------- app/docs/layout.tsx | 10 +--- app/error.tsx | 8 +--- app/layout.tsx | 28 ++++------- app/login/layout.tsx | 10 +--- app/login/page.tsx | 25 ++-------- app/page.tsx | 25 ++-------- app/pricing/layout.tsx | 10 +--- app/providers.tsx | 2 +- components/counter.tsx | 2 +- components/icons.tsx | 95 +++++-------------------------------- components/navbar.tsx | 12 ++--- components/primitives.ts | 10 +--- components/theme-switch.tsx | 34 ++++--------- 17 files changed, 78 insertions(+), 272 deletions(-) diff --git a/app/about/layout.tsx b/app/about/layout.tsx index 98956a52ad..cfdc03b801 100644 --- a/app/about/layout.tsx +++ b/app/about/layout.tsx @@ -1,13 +1,7 @@ -export default function AboutLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function AboutLayout({ children }: { children: React.ReactNode }) { return (
-
- {children} -
+
{children}
); } diff --git a/app/blog/layout.tsx b/app/blog/layout.tsx index 911d0bcf41..365caee773 100644 --- a/app/blog/layout.tsx +++ b/app/blog/layout.tsx @@ -1,13 +1,7 @@ -export default function BlogLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function BlogLayout({ children }: { children: React.ReactNode }) { return (
-
- {children} -
+
{children}
); } diff --git a/app/clouds/layout.tsx b/app/clouds/layout.tsx index d9ca1e80e4..8c8daab55d 100644 --- a/app/clouds/layout.tsx +++ b/app/clouds/layout.tsx @@ -1,8 +1,4 @@ -export default function CloudsLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function CloudsLayout({ children }: { children: React.ReactNode }) { return (
{children}
diff --git a/app/clouds/page.tsx b/app/clouds/page.tsx index a6f35d6e16..48d18551f8 100644 --- a/app/clouds/page.tsx +++ b/app/clouds/page.tsx @@ -1,43 +1,34 @@ "use client"; -import useSWR from "swr"; -import React from "react"; - +// import { PencilSquareIcon } from "@heroicons/react/24/solid"; +// import { TrashIcon } from "@heroicons/react/24/solid"; +// import { EyeIcon } from "@heroicons/react/24/solid"; import { + // Chip, + // getKeyValue, Table, - TableHeader, TableBody, - TableColumn, - TableRow, TableCell, - User, - Chip, - Tooltip, - getKeyValue, + TableColumn, + TableHeader, + TableRow, + // Tooltip, + // User, } from "@nextui-org/react"; -import { fetcher } from "@/utils/fetcher"; -import { title } from "@/components/primitives"; +import React from "react"; +import useSWR from "swr"; -import { PencilSquareIcon } from "@heroicons/react/24/solid"; -import { TrashIcon } from "@heroicons/react/24/solid"; -import { EyeIcon } from "@heroicons/react/24/solid"; +import { title } from "@/components/primitives"; +import { fetcher } from "@/utils/fetcher"; export default function CloudsPage() { - const getAccounts = useSWR( - `http://localhost:8080/api/v1/providers/aws/accounts`, - fetcher, - ); + const getAccounts = useSWR("http://localhost:8080/api/v1/providers/aws/accounts", fetcher); - const getAudits = useSWR( - `http://localhost:8080/api/v1/providers/aws/audits`, - fetcher, - ); + const getAudits = useSWR("http://localhost:8080/api/v1/providers/aws/audits", fetcher); // TODO FIX TYPE CHECKING - const getScanDetails = (account_id: Number, detail: String) => { - const scan = - getAudits.data && - getAudits.data.find((audit: any) => audit.account_id === account_id); + const getScanDetails = (account_id: number, detail: string) => { + const scan = getAudits.data && getAudits.data.find((audit: any) => audit.account_id === account_id); if (detail === "status") { return scan?.audit_complete && "Completed"; @@ -79,12 +70,8 @@ export default function CloudsPage() {

Cloud Accounts

- {getAccounts.error && ( - Failed to load - )} - {getAccounts.isLoading && ( - Loading - )} + {getAccounts.error && Failed to load} + {getAccounts.isLoading && Loading}

{getAccounts.data && ( diff --git a/app/docs/layout.tsx b/app/docs/layout.tsx index eaf63f3b99..e3d89f490a 100644 --- a/app/docs/layout.tsx +++ b/app/docs/layout.tsx @@ -1,13 +1,7 @@ -export default function DocsLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function DocsLayout({ children }: { children: React.ReactNode }) { return (
-
- {children} -
+
{children}
); } diff --git a/app/error.tsx b/app/error.tsx index 9ed5104e8a..388b7fcc7b 100644 --- a/app/error.tsx +++ b/app/error.tsx @@ -2,13 +2,7 @@ import { useEffect } from "react"; -export default function Error({ - error, - reset, -}: { - error: Error; - reset: () => void; -}) { +export default function Error({ error, reset }: { error: Error; reset: () => void }) { useEffect(() => { // Log the error to an error reporting service /* eslint-disable no-console */ diff --git a/app/layout.tsx b/app/layout.tsx index d81ea47ba9..39517f2bf1 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,10 +1,11 @@ -import { Metadata, Viewport } from "next"; -import clsx from "clsx"; - import "@/styles/globals.css"; -import { siteConfig } from "@/config/site"; -import { fontSans } from "@/config/fonts"; + +import clsx from "clsx"; +import { Metadata, Viewport } from "next"; + import { Navbar } from "@/components/navbar"; +import { fontSans } from "@/config/fonts"; +import { siteConfig } from "@/config/site"; import { Providers } from "./providers"; @@ -26,26 +27,15 @@ export const viewport: Viewport = { ], }; -export default function RootLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function RootLayout({ children }: { children: React.ReactNode }) { return ( - +
-
- {children} -
+
{children}
diff --git a/app/login/layout.tsx b/app/login/layout.tsx index d3a4a58ea4..561d6bcc49 100644 --- a/app/login/layout.tsx +++ b/app/login/layout.tsx @@ -1,13 +1,7 @@ -export default function LoginLayout({ - children, -}: { - children: React.ReactNode; -}) { +export default function LoginLayout({ children }: { children: React.ReactNode }) { return (
-
- {children} -
+
{children}
); } diff --git a/app/login/page.tsx b/app/login/page.tsx index 113f81418e..c348917daf 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -1,17 +1,9 @@ "use client"; -import React from "react"; -import { - Card, - CardHeader, - CardBody, - CardFooter, - Input, - Link, - Button, -} from "@nextui-org/react"; import { EyeIcon } from "@heroicons/react/24/solid"; import { EyeSlashIcon } from "@heroicons/react/24/solid"; +import { Button, Card, CardBody, CardFooter, CardHeader, Input, Link } from "@nextui-org/react"; +import React from "react"; export default function LoginPage() { const [isVisible, setIsVisible] = React.useState(false); @@ -26,22 +18,13 @@ export default function LoginPage() {

Login

- + +