farmcontrol-ui/src/routes/FinanceRoutes.jsx
Tom Butcher f4635d9188
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
Refactor finance and inventory components to enhance modal handling and state management
- Integrated useEffect hooks in InvoiceInfo, PaymentInfo, and other components to utilize ActionsContext for managing modal states.
- Removed unused modal states and related code to streamline component logic.
- Added setCurrentObject prop to various components for improved object handling during state changes.
- Enhanced overall code maintainability and readability by consolidating modal logic and reducing redundancy.
2026-08-01 18:25:47 +01:00

49 lines
1.3 KiB
JavaScript

import { lazy } from 'react'
import { Navigate, Route, useLocation } from 'react-router-dom'
const TaxRecordsInfoRedirect = () => {
const location = useLocation()
return (
<Navigate
to={`/dashboard/finance/taxrecords/info${location.search}`}
replace
/>
)
}
const Invoices = lazy(
() => import('../components/Dashboard/Finance/Invoices.jsx')
)
const Payments = lazy(
() => import('../components/Dashboard/Finance/Payments.jsx')
)
const FinanceOverview = lazy(
() => import('../components/Dashboard/Finance/FinanceOverview.jsx')
)
const TaxRecords = lazy(
() => import('../components/Dashboard/Finance/TaxRecords.jsx')
)
const FinanceRoutes = [
<Route
key='overview'
path='finance/overview'
element={<FinanceOverview />}
/>,
<Route key='invoices' path='finance/invoices' element={<Invoices />} />,
<Route key='payments' path='finance/payments' element={<Payments />} />,
<Route key='taxrecords' path='finance/taxrecords' element={<TaxRecords />} />,
<Route
key='taxrecords-redirect'
path='management/taxrecords'
element={<Navigate to='/dashboard/finance/taxrecords' replace />}
/>,
<Route
key='taxrecords-info-redirect'
path='management/taxrecords/info'
element={<TaxRecordsInfoRedirect />}
/>
]
export default FinanceRoutes