"use client"; import React from "react"; import styles from "./styles.module.css"; import { usePathname, useRouter } from "next/navigation"; const TopHeader = (props) => { const pathName = usePathname(); const router = useRouter(); const handleNavigateToAdd = () => { router.push(`${pathName}/add`); }; return (

{props.topbarTitle}

{!props.state && (
)} {pathName === "/credentials" ? (

Manage Env. Key

) : ( "" )} {!props.state && (

{props.buttonText}

)} {props.state === "add" ? ( <>

{props.buttonText}

router.back()}>

{props.cancelButtonText}

) : ( "" )}
); }; export default TopHeader;