add in tool bar instead

This commit is contained in:
Jun-te Kim 2025-10-23 20:19:14 +00:00
parent d156ce2b45
commit bea9d72861

View file

@ -1,93 +0,0 @@
"use client";
import { useState } from "react";
import EpcCard from "@/app/components/building-passport/EpcCard";
import { Button } from "@/app/shadcn_components/ui/button";
import { formatDateTime } from "@/app/utils";
import {
CalendarIcon,
HomeIcon,
BuildingOfficeIcon,
ClockIcon,
UserGroupIcon,
HomeModernIcon,
} from "@heroicons/react/24/solid";
import BookSurveyModal from "../../components/BookSurveyModal";
import BookingSuccessToast from "../../components/BookingSuccessToast";
interface BuildingPassportHomeClientProps {
propertyMeta: any;
portfolioId: string; // ✅ from URL (slug)
}
export default function BuildingPassportHomeClient({
propertyMeta,
portfolioId,
}: BuildingPassportHomeClientProps) {
return (
<div className="flex flex-col items-center mt-4">
{/* EPC Card + Property Info */}
<div className="flex justify-center mt-4 space-x-2">
{/* EPC Rating Card */}
<EpcCard
epcRating={propertyMeta.currentEpcRating}
fullMargin={false}
kwh={propertyMeta.detailsEpc?.currentEnergyDemand}
carbon={propertyMeta.detailsEpc?.co2Emissions}
/>
{/* Property Info Card */}
<div className="flex flex-col p-8 bg-white shadow rounded-md max-w-2xl mx-auto text-gray-700">
<div className="text-2xl font-bold mb-4">Your Property</div>
<div className="flex items-center space-x-2 mb-2">
<CalendarIcon className="h-5 w-5 text-gray-400" />
<div className="text-gray-500">Building Passport Created At:</div>
<div>{formatDateTime(propertyMeta.createdAt)}</div>
</div>
<div className="flex items-center space-x-2 mb-2">
<HomeIcon className="h-5 w-5 text-gray-400" />
<div className="text-gray-500">Property Type:</div>
<div className="text-gray-700">{propertyMeta.propertyType}</div>
</div>
<div className="flex items-center space-x-2 mb-2">
<BuildingOfficeIcon className="h-5 w-5 text-gray-400" />
<div className="text-gray-500">Built Form:</div>
<div className="text-gray-700">{propertyMeta.builtForm}</div>
</div>
<div className="flex items-center space-x-2 mb-2">
<ClockIcon className="h-5 w-5 text-gray-400" />
<div className="text-gray-500">Year Built:</div>
<div className="text-gray-700">{propertyMeta.yearBuilt}</div>
</div>
<div className="flex items-center space-x-2 mb-2">
<UserGroupIcon className="h-5 w-5 text-gray-400" />
<div className="text-gray-500">Tenure:</div>
<div className="text-gray-700">{propertyMeta.tenure}</div>
</div>
<div className="flex items-center space-x-2 mb-6">
<HomeModernIcon className="h-5 w-5 text-gray-400" />
<div className="text-gray-500">Number of Habitable Rooms:</div>
<div className="text-gray-700">{propertyMeta.numberOfRooms}</div>
</div>
</div>
</div>
{/* ✅ "Book a Survey" Button */}
<div className="mt-6">
<Button
onClick={() => setOpenModal(true)}
className="bg-brandmidblue text-white hover:bg-branddarkblue"
>
Book a Survey
</Button>
</div>
</div>
);
}