Skip to content

Commit 0a994b4

Browse files
authored
Merge pull request #91 from FIS2425/feature/90-clinical-history-button-patient
feat: add clinical history button in edit patient
2 parents 3f89993 + 4a45597 commit 0a994b4

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

src/pages/app/PatientEdit.jsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ import { getPatientById, updatePatient } from '@/services/patient';
66
import { Card, CardContent, CardDescription, CardHeader, CardFooter, CardTitle } from '@/components/ui/card';
77
import { format } from 'date-fns';
88
import { 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

1013
function 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

Comments
 (0)