feat(dashboard): add daily trend chart and statistics section to dashboard

- Introduced DailyTrendChart component for visualizing daily scraped TED notices, documents, and translated notices.
- Implemented StatisticsSection to display key metrics with animated counters and a days selector for data range.
- Created utility function to convert API data into labeled points for chart rendering.
- Updated dashboard index to include the new StatisticsSection, enhancing overall dashboard functionality and user experience.
- Refactored existing trends chart to utilize the new DailyPoint type for consistency in data handling.
This commit is contained in:
AmirReza Jamali
2026-06-07 12:39:15 +03:30
parent da1e2f89e7
commit 72948a9b55
21 changed files with 766 additions and 396 deletions
@@ -218,8 +218,15 @@ export const useAdminsPresenter = () => {
};
const clearAllFilters = useCallback(() => {
filterFormReset({
...apiDefaultParams,
offset: 0,
limit: 10,
search: "",
status: "",
});
router.push(pathName);
}, [pathName, router]);
}, [filterFormReset, pathName, router]);
const columns = [
"row",
@@ -61,8 +61,9 @@ const useCmsTablePresenter = () => {
};
const clearAllFilters = useCallback(() => {
filterFormReset({ q: "", key: "" });
router.push(pathname);
}, [pathname, router]);
}, [pathname, router, filterFormReset]);
const onConfirmDelete = () => {
if (!currentCms?.id) return;
@@ -94,8 +94,9 @@ const useCompanyCategoriesPresenter = () => {
};
const clearAllFilters = useCallback(() => {
filterFormReset({ q: "", published: undefined });
router.push(pathName);
}, [pathName, router]);
}, [pathName, router, filterFormReset]);
const onConfirmDelete = () => {
if (!currentCategory) return;
@@ -100,8 +100,15 @@ export const useCompanyListPresenter = () => {
};
const clearAllFilters = useCallback(() => {
filterFormReset({
name: "",
email: "",
phone: "",
currency: undefined,
employee_count: "",
});
router.push(pathName);
}, [pathName, router]);
}, [pathName, router, filterFormReset]);
const onConfirmDelete = () => {
if (currentCompany) {
@@ -90,8 +90,9 @@ export const useContactUsListPresenter = () => {
};
const clearAllFilters = useCallback(() => {
filterFormReset({ q: "", status: "" });
router.push(pathname);
}, [pathname, router]);
}, [pathname, router, filterFormReset]);
const onConfirmDelete = () => {
if (!currentContact) return;
@@ -125,8 +125,9 @@ const useCustomerListPresenter = () => {
};
const clearAllFilters = useCallback(() => {
filterFormReset({ status: undefined, role: undefined, type: undefined });
router.push(pathName);
}, [pathName, router]);
}, [pathName, router, filterFormReset]);
const columns = [
"row",
@@ -90,8 +90,9 @@ const useFeedbackTablePresenter = ({ id, paramKey }: IProps) => {
};
const clearAllFilters = useCallback(() => {
filterFormReset({ q: "" });
router.push(pathName);
}, [pathName, router]);
}, [pathName, router, filterFormReset]);
const getShowcaseSectionTitle = () => {
if (paramKey === "tender_id") {
@@ -88,8 +88,9 @@ const useInquiriesListPresenter = () => {
};
const clearAllFilters = useCallback(() => {
filterFormReset({ q: "", status: "" });
router.push(pathname);
}, [pathname, router]);
}, [pathname, router, filterFormReset]);
const deleteInquiry = () => {
if (!currentInquiry?.id) return;
@@ -83,8 +83,9 @@ const useNotificationHistoryTablePresenter = () => {
};
const clearAllFilters = useCallback(() => {
filterFormReset({ seen: undefined, search: "" });
router.push(pathName);
}, [pathName, router]);
}, [pathName, router, filterFormReset]);
return {
notificationHistory: data?.data,