import "./ReportDetails.scss"; import { IReport } from "@/shared/types/report-type"; import ReviewSection from "@/widgets/ReviewSection/ReviewSection"; import { Metadata } from "next"; import ReportInformation from "@/widgets/report-details/ReportInformation/ReportInformation"; import ReportImages from "@/widgets/report-details/ReportImages/ReportImages"; import dynamic from "next/dynamic"; import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs"; import { apiInstance } from "@/shared/config/apiConfig"; const DynamicMap = dynamic( () => import("@/widgets/report-details/ReportMap/ReportMap"), { ssr: false, } ); export async function generateMetadata({ params, }: { params: { id: string }; }): Promise { const response = await apiInstance.get( `/report/${params.id}/` ); return { title: `KG ROAD | ${response.data.description}`, description: `${response.data.location[0].address}, ${response.data.description}`, openGraph: { title: `KG ROAD | ${response.data.description}`, description: `${response.data.location[0].address}, ${response.data.description}`, images: [response.data.image[0].image], type: "article", }, }; } const ReportDetails = async ({ params, }: { params: { id: string }; }) => { const getReportDetails = async () => { try { const res = await fetch( `${process.env.NEXT_PUBLIC_BASE_API}/report/${params.id}/`, { cache: "no-store" } ); return res.json(); } catch (error) { console.log(error); } }; const report: IReport = await getReportDetails(); return (
); }; export default ReportDetails;