@@ -6,13 +6,17 @@ import { getPatientById, updatePatient } from '@/services/patient';
66import { Card , CardContent , CardDescription , CardHeader , CardFooter , CardTitle } from '@/components/ui/card' ;
77import { format } from 'date-fns' ;
88import { useAuth } from '@/hooks/use-auth' ;
9+ import { Button } from '@/components/ui/button' ;
10+ import { ClipboardPlus } from 'lucide-react' ;
11+ import { useNavigate } from 'react-router-dom' ;
912
1013function PatientEditPage ( { initialPatient = { } } ) {
1114 const [ patient , setPatient ] = useState ( initialPatient ) ;
1215 const [ isEditing , setIsEditing ] = useState ( false ) ;
1316 const [ errors , setErrors ] = useState ( { } ) ;
1417 const initialPatientRef = useRef ( null ) ;
1518 const { userData } = useAuth ( ) ;
19+ const navigate = useNavigate ( ) ;
1620 useEffect ( ( ) => {
1721 const fetchPatient = async ( ) => {
1822 try {
@@ -92,9 +96,17 @@ function PatientEditPage({ initialPatient = {} }) {
9296
9397 return (
9498 < Card className = "w-full max-w-md lg:min-w-[600px] rounded-lg shadow-sm" >
95- < CardHeader className = "items-start" >
96- < CardTitle > Edit Patient</ CardTitle >
97- < CardDescription > Edit patient</ CardDescription >
99+ < CardHeader >
100+ < div className = "flex items-center justify-between rounded-lg shadow-sm" >
101+ < CardTitle > Edit Patient</ CardTitle >
102+ < div className = 'flex items-center space-x-3 ml-auto' >
103+ < Button className = "px-3 py-2 gap-2 text-base ml-auto hover:text-muted-foreground" onClick = { ( ) => navigate ( `/app/history/${ patient . _id } ` ) } >
104+ < ClipboardPlus className = "h-4 w-4" />
105+ Clinical History
106+ </ Button >
107+ </ div >
108+ </ div >
109+ < CardDescription className = "text-left" > Edit patient details</ CardDescription >
98110 </ CardHeader >
99111 < CardContent >
100112 < PatientEdit
0 commit comments