feat(LensViewModal): Отображение данных о пациенте для линзы
This commit is contained in:
parent
551af24be9
commit
ac70c09509
@ -1,10 +1,39 @@
|
||||
import {Button, Col, Modal, Row, Typography} from "antd";
|
||||
import {Button, Col, Modal, Result, Row, Typography} from "antd";
|
||||
import PropTypes from "prop-types";
|
||||
import {LensPropType} from "../../../../../../../Types/lensPropType.js";
|
||||
import useLensViewModal from "./useLensViewModal.js";
|
||||
import LoadingIndicator from "../../../../../../Widgets/LoadingIndicator/LoadingIndicator.jsx";
|
||||
|
||||
const {Text, Title} = Typography;
|
||||
|
||||
const LensViewModal = ({visible, onCancel, lens}) => {
|
||||
const {
|
||||
lensIssue,
|
||||
isLensIssuesLoading,
|
||||
isLensIssuesError
|
||||
} = useLensViewModal(lens, visible);
|
||||
|
||||
if (isLensIssuesLoading) {
|
||||
return (
|
||||
<Modal>
|
||||
<LoadingIndicator/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
if (isLensIssuesError) {
|
||||
return (
|
||||
<Modal>
|
||||
<Result
|
||||
status="error"
|
||||
title="Ошибка"
|
||||
subTitle="Не удалось загрузить данные о выданных линзах"
|
||||
extra={<Button type="primary" onClick={onCancel}>Закрыть</Button>}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Просмотр линзы"
|
||||
@ -66,6 +95,12 @@ const LensViewModal = ({visible, onCancel, lens}) => {
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
{lensIssue && (
|
||||
<div style={{marginBottom: 12}}>
|
||||
<Title level={5}>👨⚕️ Пациент</Title>
|
||||
<Text>{lensIssue?.patient?.last_name} {lensIssue?.patient?.first_name}</Text>
|
||||
</div>
|
||||
)}
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
@ -11,7 +11,7 @@ const useLensViewModal = (lens, visible) => {
|
||||
pollingInterval: 60000,
|
||||
refetchOnMountOrArgChange: true,
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
lensIssue,
|
||||
isLensIssueLoading,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user