diff --git a/app/(prowler)/providers/page.tsx b/app/(prowler)/providers/page.tsx index d2e924c571..6a3f11163b 100644 --- a/app/(prowler)/providers/page.tsx +++ b/app/(prowler)/providers/page.tsx @@ -1,13 +1,35 @@ +"use client"; + +import { Button, useDisclosure } from "@nextui-org/react"; import React from "react"; -import { Header } from "@/components"; +import { Header, Modal } from "@/components"; export default function Providers() { + const { isOpen, onOpen, onClose, onOpenChange } = useDisclosure(); + + const onAction = () => { + onClose(); + }; + return ( <>

Hi hi from Providers page

+ + +

Modal body content

+ + } + actionText="Save" + onAction={onAction} + /> ); } diff --git a/components/Navbar.tsx b/components/Navbar.tsx deleted file mode 100644 index 2471830968..0000000000 --- a/components/Navbar.tsx +++ /dev/null @@ -1,60 +0,0 @@ -"use client"; - -import { - Link, - Navbar as NextUINavbar, - NavbarBrand, - NavbarContent, - NavbarItem, - NavbarMenu, - NavbarMenuItem, - NavbarMenuToggle, -} from "@nextui-org/react"; -import React from "react"; - -export const Navbar = () => { - const [isMenuOpen, setIsMenuOpen] = React.useState(false); - - const menuItems = ["Test Link", "Log Out"]; - - return ( - - - - -

PROWLER

-
-
- - - - - Login - - - - - Cloud Accounts - - - - - About - - - - - - {menuItems.map((item, index) => ( - - - {item} - - - ))} - -
- ); -}; diff --git a/components/index.ts b/components/index.ts index 97ad46bc7f..3b12cae205 100644 --- a/components/index.ts +++ b/components/index.ts @@ -1,2 +1,3 @@ export * from "./ui/header/Header"; +export * from "./ui/modal/Modal"; export * from "./ui/sidebar"; diff --git a/components/ui/modal/Modal.tsx b/components/ui/modal/Modal.tsx new file mode 100644 index 0000000000..d450c6e858 --- /dev/null +++ b/components/ui/modal/Modal.tsx @@ -0,0 +1,54 @@ +import { + Button, + Modal as ModalContainer, + ModalBody, + ModalContent, + ModalFooter, + ModalHeader, +} from "@nextui-org/react"; +import React from "react"; + +interface ModalProps { + title: string; + isOpen: boolean; + onOpenChange: (isOpen: boolean) => void; + body: React.ReactNode; + actionText?: string; + onAction?: () => void; +} + +export const Modal: React.FC = ({ + title, + isOpen, + onOpenChange, + body, + actionText, + onAction, +}) => { + const hasActionButton = actionText && onAction; + + return ( + <> + + + {(onClose) => ( + <> + {title} + {body} + + + {hasActionButton && ( + + )} + + + )} + + + + ); +}; diff --git a/package.json b/package.json index 3756a3d8e8..7fabe0be89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,5 @@ { "dependencies": { - "@heroicons/react": "^2.1.4", "@nextui-org/react": "^2.4.2", "@nextui-org/system": "2.2.1", "@nextui-org/theme": "2.2.5",