From 3b510b6d4258531bffc606739f9bd0a7331b24f2 Mon Sep 17 00:00:00 2001 From: ariari04 Date: Wed, 4 Sep 2024 22:12:45 +0600 Subject: [PATCH] Add details --- src/app/[locale]/tenders/[id]/page.tsx | 33 +++++++++++++++++++++++++ src/entities/TenderCard.tsx | 8 +++++- src/shared/types/tenders-type.ts | 9 +++++++ src/widgets/TendersList/TendersList.tsx | 3 ++- 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/app/[locale]/tenders/[id]/page.tsx b/src/app/[locale]/tenders/[id]/page.tsx index a201c4c..ccab891 100644 --- a/src/app/[locale]/tenders/[id]/page.tsx +++ b/src/app/[locale]/tenders/[id]/page.tsx @@ -11,6 +11,7 @@ const TenderDetails = async ({ const response = await apiInstance.get( `/procurements/${params.id}/` ); + console.log(response.data); return response.data; }; @@ -137,6 +138,38 @@ const TenderDetails = async ({ size="lg" className="font-bold text-[24px] mb-[30px]" /> +
+ {data.lots.length > 0 && + data.lots.map((lot) => ( +
+
+ + <Title + text={lot.name_of_lot} + className="text-[18px] font-semibold mb-[24px]" + /> + <p className="text-gray-500 ">Место работ / услуг</p> + <p>{lot.address_of_lots}</p> + </div> + <div> + <p>Планируемая сумма</p> + <Title text={lot.summ} className="text-[18px] font-semibold" /> + </div> + </div> + ))} + </div> + + <Title + text={"Документы"} + size="lg" + className="font-bold text-[24px] mb-[30px]" + /> </Container> ); }; diff --git a/src/entities/TenderCard.tsx b/src/entities/TenderCard.tsx index 4fd54e7..45ab684 100644 --- a/src/entities/TenderCard.tsx +++ b/src/entities/TenderCard.tsx @@ -12,6 +12,7 @@ interface Props { date_of_publication_datetime: string; date_of_offer_datetime: string; current_timestamp: string; + plan_summ: string; } const TenderCard: React.FC<Props> = ({ id, @@ -23,7 +24,9 @@ const TenderCard: React.FC<Props> = ({ date_of_publication_datetime, date_of_offer_datetime, current_timestamp, + plan_summ, }: Props) => { + console.log(plan_summ); return ( <div className="w-full min-h-[213px] bg-white shadow-sm rounded-sm flex gap-[82px] items-center p-6"> <div className="w-[840px] flex flex-col"> @@ -42,7 +45,10 @@ const TenderCard: React.FC<Props> = ({ {name_of_organization} </h2> </div> - <div className="w-[285px]"></div> + <div className="w-[285px]"> + <p className="text-[14px] leading-6">Планируемая сумма</p> + <Title text={plan_summ} /> + </div> </div> ); }; diff --git a/src/shared/types/tenders-type.ts b/src/shared/types/tenders-type.ts index 959b54d..dd53572 100644 --- a/src/shared/types/tenders-type.ts +++ b/src/shared/types/tenders-type.ts @@ -1,5 +1,13 @@ import { IList } from "./list-type"; +export interface Lot { + id: number; + id_of_lot: string; + name_of_lot: string; + summ: string; + address_of_lots: string; + procurement: number; +} export interface ITenders { id: number; id_of_card: string; @@ -14,6 +22,7 @@ export interface ITenders { tel_number: string; more_info_url: string; more_info_pdf: string; + lots: Lot[]; } export interface ITendersList extends IList { diff --git a/src/widgets/TendersList/TendersList.tsx b/src/widgets/TendersList/TendersList.tsx index 56a6e90..b57ba13 100644 --- a/src/widgets/TendersList/TendersList.tsx +++ b/src/widgets/TendersList/TendersList.tsx @@ -19,7 +19,7 @@ const TendersList: React.FC<Props> = ({ searchParams }) => { useEffect(() => { getTenders(activePage); }, [activePage]); - + console.log(tenders); const handleSubmit = () => {}; return ( <div> @@ -41,6 +41,7 @@ const TendersList: React.FC<Props> = ({ searchParams }) => { date_of_publication_datetime={tender.date_of_publication_datetime} date_of_offer_datetime={tender.date_of_offer_datetime} current_timestamp={tender.current_timestamp} + plan_summ={tender.plan_summ} /> ))} <Pagination