+
Click on Add new to start adding properties to your Portfolio
@@ -91,6 +91,170 @@ function Propertycards({
);
}
+interface SummaryBoxProps {
+ budget: number | null;
+ totalCost: number | null;
+ properties: Property[];
+ co2EquivalentSavings: number | null;
+ totalWorkHours: number | null;
+ propertyValuationIncrease: number | null;
+ rentalYieldIncrease: number | null;
+ energySavings: number | null;
+ energyCostSavings: number | null;
+}
+
+function SummaryBox({
+ budget,
+ totalCost,
+ properties,
+ co2EquivalentSavings,
+ totalWorkHours,
+ propertyValuationIncrease,
+ rentalYieldIncrease,
+ energySavings,
+ energyCostSavings,
+}: SummaryBoxProps) {
+ function formatMoney(amount: number | null) {
+ if (amount === null) {
+ return "£0";
+ } else {
+ return "£" + amount.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, "$&,");
+ }
+ }
+
+ function formatHours(hours: number | null) {
+ if (hours === null) {
+ return "0 hours";
+ } else {
+ return hours + " hours";
+ }
+ }
+
+ function formatCo2(co2: number | null) {
+ if (co2 === null) {
+ return "0 tonnes";
+ } else {
+ return co2 + " tonnes";
+ }
+ }
+
+ function formatKwh(energy: number | null) {
+ if (energy === null) {
+ return "0 Kwh";
+ } else {
+ return energy + " Kwh";
+ }
+ }
+
+ const budgetFormatted = formatMoney(budget);
+ const totalCostFormatted = formatMoney(totalCost);
+ const totalValueIncreaseFormatted = formatMoney(propertyValuationIncrease);
+ const totalWorkHoursFormatted = formatHours(totalWorkHours);
+ const rentalYieldIncreaseFormatted = formatMoney(rentalYieldIncrease);
+ const energyCostSavingsFormatted = formatMoney(energyCostSavings);
+ const co2EquivalentSavingsFormatted = formatCo2(co2EquivalentSavings);
+ const energySavingsFormatted = formatKwh(energySavings);
+
+ return (
+
+
+ Portfolio Summary
+
+
+
+
+ Financials
+
+
+
+
+ | Budget |
+ {budgetFormatted} |
+
+
+ | Total Cost |
+ {totalCostFormatted} |
+
+
+ |
+ Total Value Increase
+ |
+
+ {totalValueIncreaseFormatted}
+ |
+
+
+ |
+ Annual rental yield Increase
+ |
+
+ {rentalYieldIncreaseFormatted}
+ |
+
+
+ |
+ Annual Energy Bill Savings
+ |
+
+ {energyCostSavingsFormatted}
+ |
+
+
+
+
+
+
+ Property Data
+
+
+
+
+ |
+ Number of properties
+ |
+ {properties.length} |
+
+
+ |
+ Total Works Time
+ |
+
+ {totalWorkHoursFormatted}
+ |
+
+
+
+
+
+
+ Environmental Impact
+
+
+
+
+ |
+ Annual Co2 Savings
+ |
+
+ {co2EquivalentSavingsFormatted}
+ |
+
+
+ |
+ Annual Energy Savings
+ |
+
+ {energySavingsFormatted}
+ |
+
+
+
+
+
+
+ );
+}
+
export default async function Page({
params,
searchParams,
@@ -112,6 +276,8 @@ export default async function Page({
totalWorkHours,
propertyValuationIncrease,
rentalYieldIncrease,
+ energySavings,
+ energyCostSavings,
} = await getPortfolio(portfolioId);
const properties: Property[] = [];
@@ -119,54 +285,33 @@ export default async function Page({
return (
<>
-
- Portfolio: {portfolioName}
+
+ {portfolioName}
-
-
-
-
-
-
- Portfolio Summary
-
-
- -
- Budget: {budget || "Not Set"}
-
-
- -
- Total Cost: £{totalCost}
-
- -
- Number of properties: {properties.length}
-
- -
- Annual Co2 Savings: {co2EquivalentSavings} tonnes
-
- -
- Total Works Time: {totalWorkHours} hours
-
- -
- Total Value Increase: £{propertyValuationIncrease}
-
- -
- Annual rental yield Increase: £{rentalYieldIncrease}
-
-
-
+
+
+
-
+
{properties.length === 0 ? (
) : (
diff --git a/src/app/shadcn_components/ui/navigation-menu.tsx b/src/app/shadcn_components/ui/navigation-menu.tsx
index 1419f56..ba3dfb5 100644
--- a/src/app/shadcn_components/ui/navigation-menu.tsx
+++ b/src/app/shadcn_components/ui/navigation-menu.tsx
@@ -1,9 +1,9 @@
-import * as React from "react"
-import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
-import { cva } from "class-variance-authority"
-import { ChevronDown } from "lucide-react"
+import * as React from "react";
+import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
+import { cva } from "class-variance-authority";
+import { ChevronDown } from "lucide-react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const NavigationMenu = React.forwardRef<
React.ElementRef,
@@ -20,8 +20,8 @@ const NavigationMenu = React.forwardRef<
{children}
-))
-NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
+));
+NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
const NavigationMenuList = React.forwardRef<
React.ElementRef,
@@ -35,14 +35,14 @@ const NavigationMenuList = React.forwardRef<
)}
{...props}
/>
-))
-NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
+));
+NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
-const NavigationMenuItem = NavigationMenuPrimitive.Item
+const NavigationMenuItem = NavigationMenuPrimitive.Item;
const navigationMenuTriggerStyle = cva(
- "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
-)
+ "bg-gray-50 cursor-pointer group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-gray-200 hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
+);
const NavigationMenuTrigger = React.forwardRef<
React.ElementRef,
@@ -59,8 +59,8 @@ const NavigationMenuTrigger = React.forwardRef<
aria-hidden="true"
/>
-))
-NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
+));
+NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
const NavigationMenuContent = React.forwardRef<
React.ElementRef,
@@ -74,10 +74,10 @@ const NavigationMenuContent = React.forwardRef<
)}
{...props}
/>
-))
-NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
+));
+NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
-const NavigationMenuLink = NavigationMenuPrimitive.Link
+const NavigationMenuLink = NavigationMenuPrimitive.Link;
const NavigationMenuViewport = React.forwardRef<
React.ElementRef,
@@ -93,9 +93,9 @@ const NavigationMenuViewport = React.forwardRef<
{...props}
/>
-))
+));
NavigationMenuViewport.displayName =
- NavigationMenuPrimitive.Viewport.displayName
+ NavigationMenuPrimitive.Viewport.displayName;
const NavigationMenuIndicator = React.forwardRef<
React.ElementRef
,
@@ -111,9 +111,9 @@ const NavigationMenuIndicator = React.forwardRef<
>
-))
+));
NavigationMenuIndicator.displayName =
- NavigationMenuPrimitive.Indicator.displayName
+ NavigationMenuPrimitive.Indicator.displayName;
export {
navigationMenuTriggerStyle,
@@ -125,4 +125,4 @@ export {
NavigationMenuLink,
NavigationMenuIndicator,
NavigationMenuViewport,
-}
+};
diff --git a/tailwind.config.js b/tailwind.config.js
index e20a48e..95b5342 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -93,6 +93,9 @@ module.exports = {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
},
+ maxWidth: {
+ "8xl": "90rem",
+ },
},
},
variants: {