diff --git a/src/app/components/portfolio/Toolbar.tsx b/src/app/components/portfolio/Toolbar.tsx index 4d85b716..f525e083 100644 --- a/src/app/components/portfolio/Toolbar.tsx +++ b/src/app/components/portfolio/Toolbar.tsx @@ -1,6 +1,10 @@ "use client"; -import { Cog6ToothIcon, CalculatorIcon } from "@heroicons/react/24/outline"; +import { + Cog6ToothIcon, + CalculatorIcon, + BuildingOfficeIcon, +} from "@heroicons/react/24/outline"; import { NavigationMenu, NavigationMenuItem, @@ -10,6 +14,7 @@ import AddNewDropDown from "./AddNew"; import { cva } from "class-variance-authority"; import UploadCsvModal from "@/app/portfolio/[slug]/components/UploadCsvModal"; import { useState } from "react"; +import { useRouter } from "next/navigation"; interface ToolbarProps { portfolioId: string; @@ -20,12 +25,18 @@ const navigationMenuTriggerStyle = cva( ); export function Toolbar({ portfolioId }: ToolbarProps) { + const router = useRouter(); + function handleClickSettings() { console.log("Settings were clicked, implement me"); } function handleClickPortfolioPlan() { - console.log("Opt Plan was clicked, implement me"); + router.push(`/portfolio/${portfolioId}/plan`); + } + + function handleClickPortfolio() { + router.push(`/portfolio/${portfolioId}`); } const [modalIsOpen, setModalIsOpen] = useState(false); @@ -33,6 +44,14 @@ export function Toolbar({ portfolioId }: ToolbarProps) { return ( + + + Portfolio + + +
+

+ {portfolioName} +

+
+
+
+
+ +
+
+
+ {children} + + ); +} diff --git a/src/app/portfolio/[slug]/page.tsx b/src/app/portfolio/[slug]/(portfolio)/page.tsx similarity index 91% rename from src/app/portfolio/[slug]/page.tsx rename to src/app/portfolio/[slug]/(portfolio)/page.tsx index f1bbd8c5..0dcc3d8e 100644 --- a/src/app/portfolio/[slug]/page.tsx +++ b/src/app/portfolio/[slug]/(portfolio)/page.tsx @@ -1,5 +1,5 @@ import { HomeIcon } from "@heroicons/react/24/outline"; -import { getPortfolio, getProperties } from "./utils"; +import { getPortfolio, getProperties } from "../utils"; import { Toolbar } from "@/app/components/portfolio/Toolbar"; import DataTable from "@/app/portfolio/[slug]/components/propertyTable"; import { columns } from "@/app/portfolio/[slug]/components/propertyTableColumns"; @@ -187,12 +187,8 @@ export default async function Page({ }) { // This page is served from the server so we can make calls to the database - // This is temp until we retrieve this data from the frontend - // TODO: Update the objects to contains objective + any other required information - const portfolioId = params.slug; const { - name: portfolioName, budget, cost: totalCost, co2EquivalentSavings, @@ -212,18 +208,6 @@ export default async function Page({ return ( <> -
-

- {portfolioName} -

-
-
-
-
- -
-
-
diff --git a/src/app/portfolio/[slug]/(portfolio)/plan/page.tsx b/src/app/portfolio/[slug]/(portfolio)/plan/page.tsx new file mode 100644 index 00000000..c01caf20 --- /dev/null +++ b/src/app/portfolio/[slug]/(portfolio)/plan/page.tsx @@ -0,0 +1,7 @@ +export default async function PortfolioPlan({ + params, +}: { + params: { slug: string; propertyId: string; planId: string }; +}) { + return
Portfolio Plan
; +} diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx index bbbee524..06d0a90a 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx @@ -8,10 +8,8 @@ export default async function Recommendations({ params: { slug: string; propertyId: string; planId: string }; }) { const propertyMeta = await getPropertyMeta(params.propertyId); - const recommendations = await getRecommendations(params.planId); - console.log(recommendations); return (
Recommendations
diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts b/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts index 9cfba534..f7c82012 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts @@ -1,4 +1,4 @@ -import { recommendation } from "./../../../../db/schema/recommendations"; +import { recommendation } from "../../../../db/schema/recommendations"; import { Recommendation, planRecommendations,