diff --git a/src/app/portfolio/[slug]/page.tsx b/src/app/portfolio/[slug]/page.tsx index 4692695..21af412 100644 --- a/src/app/portfolio/[slug]/page.tsx +++ b/src/app/portfolio/[slug]/page.tsx @@ -1,5 +1,3 @@ -"use client"; - import { PencilSquareIcon, HomeIcon } from "@heroicons/react/24/outline"; import AddNew from "../../components/portfolio/AddNew"; import { formatNumber } from "@/app/utils"; @@ -9,75 +7,6 @@ import { ArrowRightCircleIcon } from "@heroicons/react/20/solid"; import { Badge } from "@/app/shadcn_components/ui/badge"; import { PortfolioStage } from "@/types/portfolio"; import StatusBadge from "@/app/components/StatusBadge"; -import { useState } from "react"; - -import { Button } from "@/app/shadcn_components/ui/button"; -import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/app/shadcn_components/ui/dialog"; -// import { Input } from "@/components/ui/input"; -// import { Label } from "@/components/ui/label"; - -export function DialogDemo({ - budget, - setBudget, -}: { - budget: string | number | string[] | undefined; - setBudget: (budget: number | string | undefined | string[]) => void; -}) { - const [budgetInput, setBudgetInput] = useState(null); - - function handleSubmit() { - if (budgetInput !== null) { - setBudget(budgetInput); - } - // setIsOpen(false); - } - - return ( - - -
  • - Budget: {budget || "Not Set"} - -
  • -
    - - - Edit profile - - Make changes to your profile here. Click save when you're done. - - -
    -
    - {/* */} - {/* */} -
    -
    - {/* - */} -
    -
    - - - -
    -
    - ); -} function generateProperties( value: number, @@ -183,15 +112,10 @@ export default async function Page({ searchParams, }: { params: { slug: string }; - searchParams: { [key: string]: string[] | undefined | number }; + searchParams: { [key: string]: string | string[] | undefined | number }; }) { // This is temp until we retrieve this data from the frontend // TODO: Update the objects to contains objective + any other required information - const [isBudgetModalOpen, setIsBudgetModalOpen] = useState(false); - const [budget, setBudget] = useState< - number | string | undefined | string[] | "Not set" - >("Not set"); - const Portfolios = [ { id: "f290f1ee-6c54-4b01-90e6-d701748f0851", @@ -332,6 +256,7 @@ export default async function Page({ let page_config; let pageName; + let budget; let co2Reduction: number; let totalWorksHours: number; let totalValueIncrease: number; @@ -343,22 +268,18 @@ export default async function Page({ ...searchParams, }; pageName = searchParams.name; + budget = searchParams.budget; co2Reduction = 0; totalWorksHours = 0; totalValueIncrease = 0; rentalYieldIncrease = 0; totalCost = 0; - if (searchParams.budget !== budget) { - setBudget(searchParams.budget); - } } else { page_config = Portfolios.filter((portfolio) => { return portfolio.id == params.slug; })[0]; pageName = page_config.title; - if (page_config.budget !== budget) { - setBudget(page_config.budget); - } + budget = page_config.budget; co2Reduction = page_config.co2Reduction as number; totalWorksHours = page_config.totalWorksHours as number; totalValueIncrease = page_config.totalValueIncrease as number; @@ -369,6 +290,10 @@ export default async function Page({ // TODO: Put this back in for demo const properties = page_config.properties; + // TODO: Add the porfolio summary information on the left + // Add an empty state for when there are no properties + // Create populated state for when there are properties + return ( <>
    @@ -387,7 +312,10 @@ export default async function Page({ Portfolio Summary