From c572fe8a21a60096243e775eb46be3923dc51385 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 25 Jul 2023 14:02:24 +0100 Subject: [PATCH] basic UI for proprty information --- src/app/db/schema/property.ts | 9 +++ .../building-passport/[propertyId]/layout.tsx | 11 ++- .../building-passport/[propertyId]/page.tsx | 78 +++++++++++++++++-- 3 files changed, 91 insertions(+), 7 deletions(-) diff --git a/src/app/db/schema/property.ts b/src/app/db/schema/property.ts index 89c8c48..121d7c4 100644 --- a/src/app/db/schema/property.ts +++ b/src/app/db/schema/property.ts @@ -5,4 +5,13 @@ export interface PropertyMeta { postcode: string; hasPreConditionReport: boolean; hasRecommendations: boolean; + createdAt: string; + propertyType: string; + builtForm: string; + localAuthority: string; + constituency: string; + numberOfRooms: number; + yearBuilt: number; + tenure: string; + currentEpcRating: string; } diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/layout.tsx b/src/app/portfolio/[slug]/building-passport/[propertyId]/layout.tsx index 6760808..85058c4 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/layout.tsx +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/layout.tsx @@ -18,8 +18,16 @@ export default function DashboardLayout({ postcode: "AB1 2CD", hasPreConditionReport: true, hasRecommendations: true, + createdAt: "2023-07-12 11:51:31.000 +0100", + propertyType: "House", + builtForm: "Detached", + localAuthority: "Birmingham", + constituency: "Birmingham", + numberOfRooms: 5, + yearBuilt: 1990, + tenure: "Rented (social)", + currentEpcRating: "C", }; - if (!propertyId && propertyId !== 0) { throw Error("Invalid propertyId"); } @@ -40,7 +48,6 @@ export default function DashboardLayout({
- {children} diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/page.tsx b/src/app/portfolio/[slug]/building-passport/[propertyId]/page.tsx index a9a25e8..7a70db8 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/page.tsx +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/page.tsx @@ -1,10 +1,78 @@ -import { Button } from "@/app/shadcn_components/ui/button"; -import { Toolbar } from "@/app/components/building-passport/Toolbar"; +import { PropertyMeta } from "@/app/db/schema/property"; +import { + HomeIcon, + BuildingOfficeIcon, + CalendarIcon, + HomeModernIcon, + ClockIcon, + UserGroupIcon, +} from "@heroicons/react/24/solid"; -export default function BuildingPassportHome() { +function EpcCard({ epcRating }: { epcRating: string }) { return ( -
-
Basic information
+
+
Energy Rating
+
{epcRating}
+
+ ); +} + +export default function BuildingPassportHome() { + const propertyMeta: PropertyMeta = { + id: 1, + address: "123 Fake Street", + postcode: "AB1 2CD", + hasPreConditionReport: true, + hasRecommendations: true, + createdAt: "2023-07-12 11:51:31.000 +0100", + propertyType: "House", + builtForm: "Detached", + localAuthority: "Birmingham", + constituency: "Birmingham", + numberOfRooms: 5, + yearBuilt: 1990, + tenure: "Rented (social)", + currentEpcRating: "C", + }; + + return ( +
+
+ +
+
Your property
+
+ +
Building Passport Created At:
+
{propertyMeta.createdAt}
+
+
+ +
Property Type:
+
{propertyMeta.propertyType}
+
+
+ +
Built Form:
+
{propertyMeta.builtForm}
+
+
+ +
Year Built:
+
{propertyMeta.yearBuilt}
+
+
+ +
Tenure:
+
{propertyMeta.tenure}
+
+
+ +
Number of Rooms:
+
{propertyMeta.numberOfRooms}
+
+
+
); }