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 = () => { ( - - Информация о пациенте - + )} />