Files
worklenz/worklenz-frontend/src/app/routes/reporting-routes.tsx
chamiakJ 591d348ae5 feat(localization): update and enhance localization files for multiple languages
- Updated localization files for various languages, including English, German, Spanish, Portuguese, and Chinese, to ensure consistency and accuracy across the application.
- Added new keys and updated existing ones to support recent UI changes and features, particularly in project views, task lists, and admin center settings.
- Enhanced the structure of localization files to improve maintainability and facilitate future updates.
- Implemented performance optimizations in the frontend components to better handle localization data.
2025-07-28 07:19:55 +05:30

31 lines
995 B
TypeScript

import { RouteObject } from 'react-router-dom';
import { Suspense } from 'react';
import ReportingLayout from '@/layouts/ReportingLayout';
import { ReportingMenuItems, reportingsItems } from '@/lib/reporting/reporting-constants';
import { SuspenseFallback } from '@/components/suspense-fallback/suspense-fallback';
// function to flatten nested menu items
const flattenItems = (items: ReportingMenuItems[]): ReportingMenuItems[] => {
return items.reduce<ReportingMenuItems[]>((acc, item) => {
if (item.children) {
return [...acc, ...flattenItems(item.children)];
}
return [...acc, item];
}, []);
};
const flattenedItems = flattenItems(reportingsItems);
const reportingRoutes: RouteObject[] = [
{
path: 'worklenz/reporting',
element: <ReportingLayout />,
children: flattenedItems.map(item => ({
path: item.endpoint,
element: <Suspense fallback={<SuspenseFallback />}>{item.element}</Suspense>,
})),
},
];
export default reportingRoutes;