feat(dashboard): refactor home page to utilize TenderDashboard component
- Replaced the previous home page structure with a simplified TenderDashboard component for improved clarity and maintainability. - Updated the .gitignore file to include IDE-specific files, ensuring a cleaner repository. - Enhanced the useTenderListPresenter to support new parsing logic for cpv_codes in search parameters. - Introduced a new utility function, buildQueryString, for better handling of query parameters in API requests.
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
"use client";
|
||||
|
||||
import { ClosingSoonCard } from "./closing-soon";
|
||||
import { CountryDistribution } from "./country-distribution";
|
||||
import { DashboardHero } from "./hero";
|
||||
import { NoticeTypeBreakdown } from "./notice-types";
|
||||
import { RecentTenders } from "./recent-tenders";
|
||||
import { TenderStatCards } from "./stat-cards";
|
||||
import { TenderTrendsChart } from "./trends-chart";
|
||||
import { useDashboardData } from "./use-dashboard-data";
|
||||
|
||||
export function TenderDashboard() {
|
||||
const {
|
||||
isPending,
|
||||
total,
|
||||
active,
|
||||
closingSoon,
|
||||
totalValue,
|
||||
valueCurrency,
|
||||
countries,
|
||||
noticeTypes,
|
||||
trend,
|
||||
recent,
|
||||
recentIsLoading,
|
||||
closingSoonList,
|
||||
} = useDashboardData();
|
||||
|
||||
return (
|
||||
<div className="space-y-4 md:space-y-6 2xl:space-y-7.5">
|
||||
<DashboardHero
|
||||
total={total}
|
||||
active={active}
|
||||
closingSoon={closingSoon}
|
||||
isLoading={isPending}
|
||||
/>
|
||||
|
||||
<TenderStatCards
|
||||
total={total}
|
||||
active={active}
|
||||
closingSoon={closingSoon}
|
||||
totalValue={totalValue}
|
||||
valueCurrency={valueCurrency}
|
||||
isLoading={isPending}
|
||||
/>
|
||||
|
||||
<div className="grid grid-cols-12 gap-4 md:gap-6 2xl:gap-7.5">
|
||||
<div className="col-span-12 xl:col-span-8">
|
||||
<TenderTrendsChart data={trend} isLoading={isPending} />
|
||||
</div>
|
||||
<div className="col-span-12 xl:col-span-4">
|
||||
<CountryDistribution countries={countries} isLoading={isPending} />
|
||||
</div>
|
||||
|
||||
<div className="col-span-12 xl:col-span-5">
|
||||
<NoticeTypeBreakdown
|
||||
noticeTypes={noticeTypes}
|
||||
isLoading={isPending}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-12 xl:col-span-7">
|
||||
<ClosingSoonCard tenders={closingSoonList} isLoading={isPending} />
|
||||
</div>
|
||||
|
||||
<div className="col-span-12">
|
||||
<RecentTenders tenders={recent} isLoading={recentIsLoading} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user