11import React from 'react' ;
22import { useTranslation } from 'react-i18next' ;
3+ import { useNavigate } from 'react-router-dom' ;
34import {
45 Connect ,
56 Settings ,
@@ -15,63 +16,64 @@ import styles from './system-admin.scss';
1516
1617const SystemAdminDashboard : React . FC = ( ) => {
1718 const { t } = useTranslation ( ) ;
19+ const navigate = useNavigate ( ) ;
1820
1921 const navItems = [
2022 {
2123 id : 'sync-profiles' ,
2224 label : t ( 'syncProfiles' , 'Sync Profiles' ) ,
2325 description : t ( 'syncProfilesDesc' , 'Configure and manage FHIR sync profiles' ) ,
2426 icon : Connect ,
25- path : '/system-admin/ sync-profiles' ,
27+ path : '/sync-profiles' ,
2628 } ,
2729 {
2830 id : 'sync-task-types' ,
2931 label : t ( 'syncTaskTypes' , 'Sync Task Types' ) ,
3032 description : t ( 'syncTaskTypesDesc' , 'Manage sync task types and view execution history' ) ,
3133 icon : Settings ,
32- path : '/system-admin/ sync-task-types' ,
34+ path : '/sync-task-types' ,
3335 } ,
3436 {
3537 id : 'schedule-tasks' ,
3638 label : t ( 'scheduleTaskManager' , 'Schedule Task Manager' ) ,
3739 description : t ( 'scheduleTaskManagerDesc' , 'Schedule and automate recurring tasks' ) ,
3840 icon : Calendar ,
39- path : '/system-admin/ schedule-tasks' ,
41+ path : '/schedule-tasks' ,
4042 } ,
4143 {
4244 id : 'cohort-management' ,
4345 label : t ( 'cohortManagement' , 'Cohort Management' ) ,
4446 description : t ( 'cohortManagementDesc' , 'Manage DSD refill groups and patient enrollment' ) ,
4547 icon : Group ,
46- path : '/system-admin/ cohort-management' ,
48+ path : '/cohort-management' ,
4749 } ,
4850 {
4951 id : 'viral-load-upload' ,
5052 label : t ( 'viralLoadUpload' , 'Viral Load Upload' ) ,
5153 description : t ( 'viralLoadUploadDesc' , 'Upload viral load test results from CPHL' ) ,
5254 icon : Upload ,
53- path : '/system-admin/ viral-load-upload' ,
55+ path : '/viral-load-upload' ,
5456 } ,
5557 {
5658 id : 'sms-settings' ,
5759 label : t ( 'sms' , 'SMS' ) ,
5860 description : t ( 'smsDesc' , 'Configure SMS gateway and view sent message logs' ) ,
5961 icon : Mobile ,
60- path : '/system-admin/ sms-settings' ,
62+ path : '/sms-settings' ,
6163 } ,
6264 {
6365 id : 'system-upgrades' ,
6466 label : t ( 'systemUpgrades' , 'System Updates & Upgrades' ) ,
6567 description : t ( 'systemUpgradesDesc' , 'Execute system upgrades and update EMR components' ) ,
6668 icon : Renew ,
67- path : '/system-admin/system- upgrades' ,
69+ path : '/system-upgrades' ,
6870 } ,
6971 {
7072 id : 'about-systems' ,
7173 label : t ( 'aboutSystems' , 'About Systems' ) ,
7274 description : t ( 'aboutSystemsDesc' , 'View system information, version details, and facility code' ) ,
7375 icon : Information ,
74- path : '/system-admin/ about-systems' ,
76+ path : '/about-systems' ,
7577 } ,
7678 ] ;
7779
@@ -85,18 +87,18 @@ const SystemAdminDashboard: React.FC = () => {
8587 { navItems . map ( ( item ) => {
8688 const Icon = item . icon ;
8789 return (
88- < a
90+ < button
8991 key = { item . id }
9092 className = { styles . dashboardCard }
91- href = { item . path }
93+ onClick = { ( ) => navigate ( item . path ) }
9294 >
9395 < div className = { styles . cardIcon } >
9496 < Icon size = { 32 } />
9597 </ div >
9698 < h3 > { item . label } </ h3 >
9799 < p > { item . description } </ p >
98100 < ChevronRight size = { 20 } className = { styles . cardArrow } />
99- </ a >
101+ </ button >
100102 ) ;
101103 } ) }
102104 </ div >
0 commit comments