+
-
- {tenantDetails.building.name}
-
+ Bygningsinformasjon
@@ -105,12 +106,10 @@ export default async function BuildingTenant({
-
- {tenantDetails.property.name}
-
+ Eiendomsinformasjon
@@ -121,6 +120,20 @@ export default async function BuildingTenant({
Navn
{tenantDetails.property.name}
+
+ Adresse
+
+ {tenantDetails.property.address || "Ikke angitt"}
+
+
+
+ Størrelse
+
+ {tenantDetails.property.size
+ ? `${tenantDetails.property.size} m²`
+ : "Ikke angitt"}
+
+
diff --git a/apps/www/src/app/(tenant)/tenant/[id]/contract2/building/_components/BuildingFormContract.tsx b/apps/www/src/app/(tenant)/tenant/[id]/contract/building/_components/BuildingFormContract.tsx
similarity index 96%
rename from apps/www/src/app/(tenant)/tenant/[id]/contract2/building/_components/BuildingFormContract.tsx
rename to apps/www/src/app/(tenant)/tenant/[id]/contract/building/_components/BuildingFormContract.tsx
index ec96702..ce47e2c 100644
--- a/apps/www/src/app/(tenant)/tenant/[id]/contract2/building/_components/BuildingFormContract.tsx
+++ b/apps/www/src/app/(tenant)/tenant/[id]/contract/building/_components/BuildingFormContract.tsx
@@ -54,15 +54,19 @@ export function BuildingFormContract({ tenantDetails }) {
property: tenantDetails?.property?.id?.toString() || "",
floor: tenantDetails?.floor?.id?.toString() || "",
officeSpace: tenantDetails?.officeSpace?.id?.toString() || "",
- contactId: tenantDetails?.contacts[0]?.id?.toString() || "", // Assuming there's at least one contact
+ contactId: tenantDetails?.contacts[0]?.id?.toString() || "",
},
})
useEffect(() => {
if (tenantDetails?.floor?.id) {
setSelectedFloor(tenantDetails.floor.id.toString())
+ form.setValue("floor", tenantDetails.floor.id.toString())
}
- }, [tenantDetails?.floor?.id])
+ if (tenantDetails?.officeSpace?.id) {
+ form.setValue("officeSpace", tenantDetails.officeSpace.id.toString())
+ }
+ }, [tenantDetails, form])
const onSubmit = async (data) => {
setIsLoading(true)
@@ -158,7 +162,7 @@ export function BuildingFormContract({ tenantDetails }) {
)}
/>
-
(
@@ -232,7 +236,7 @@ export function BuildingFormContract({ tenantDetails }) {
)}
- />
+ /> */}