From 1101706f612becfc711078a674721aa931ded18e Mon Sep 17 00:00:00 2001 From: Andrei Duvakin Date: Mon, 10 Feb 2025 17:27:29 +0500 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=BA?= =?UTF-8?q?=D0=B0=D1=80=D1=82=D0=BE=D1=87=D0=BA=D1=83=20=D0=BF=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-app/src/components/PatientListCard.jsx | 32 ++++++++++++++++++++++ web-app/src/pages/PatientsPage.jsx | 7 ++--- 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 web-app/src/components/PatientListCard.jsx diff --git a/web-app/src/components/PatientListCard.jsx b/web-app/src/components/PatientListCard.jsx new file mode 100644 index 0000000..783a65f --- /dev/null +++ b/web-app/src/components/PatientListCard.jsx @@ -0,0 +1,32 @@ +import { Card } from "antd"; +import PropTypes from "prop-types"; + +const PatientListCard = ({ patient }) => { + return ( + +

📅 Дата рождения: {patient.birthday}

+ {patient.phone &&

📞 Телефон: {patient.phone}

} + {patient.email &&

✉️ Email: {patient.email}

} + {patient.diagnosis &&

🩺 Диагноз: {patient.diagnosis}

} +
+ ); +}; + +PatientListCard.propTypes = { + patient: PropTypes.shape({ + last_name: PropTypes.string.isRequired, + first_name: PropTypes.string.isRequired, + patronymic: PropTypes.string, + birthday: PropTypes.string.isRequired, + address: PropTypes.string, + email: PropTypes.string, + phone: PropTypes.string, + diagnosis: PropTypes.string, + correction: PropTypes.string, + }).isRequired, +}; + +export default PatientListCard; diff --git a/web-app/src/pages/PatientsPage.jsx b/web-app/src/pages/PatientsPage.jsx index 454a8d7..abf9eab 100644 --- a/web-app/src/pages/PatientsPage.jsx +++ b/web-app/src/pages/PatientsPage.jsx @@ -3,6 +3,7 @@ import {Input, Select, List, Card, Button, FloatButton} from "antd"; import {PlusOutlined} from "@ant-design/icons"; import {useAuth} from "../AuthContext.jsx"; import getAllPatients from "../api/GetAllPatients.jsx"; +import PatientListCard from "../components/PatientListCard.jsx"; const {Search} = Input; const {Option} = Select; @@ -58,13 +59,11 @@ const PatientsPage = () => { ( - - Информация о пациенте - + )} />