DoctorMenuPresenter.tsx
9.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
import React from 'react';
import * as styled from './DoctorMenuStyled';
interface DoctorMenuProps {
info : {
infoType : string;
userNm : string;
doctorType : string | null;
contact : string;
userAge : number | null;
patientInfo : string;
};
searchPatientKeyword : string;
onSetKeyword : React.ChangeEventHandler<HTMLInputElement>;
filteringPatientList : any[];
patientDetail : any;
onFetchPatientDetail : (arg0 : string) => void;
onInitialize : () => void;
editModal : boolean;
setEditModal : any;
newPatientRegisterModal : boolean;
setNewPatientRegisterModal : any;
}
const DoctorMenuPresenter = (props : DoctorMenuProps) => {
return (
<styled.Container>
{
props.editModal ?
<styled.ModalContainer>
<styled.ModalClsButtonWrapper>
<styled.ModalClsButton
onClick = {() => props.setEditModal(false)}
>
<styled.ModalClsButtonImg />
<styled.ModalClsButtonText>닫기</styled.ModalClsButtonText>
</styled.ModalClsButton>
</styled.ModalClsButtonWrapper>
<styled.ModalContentWrapper>
<styled.ModalContent>
<styled.NewPatientRegisterTitle>새 환자 등록</styled.NewPatientRegisterTitle>
<styled.NewPatientSearchWrapper>
<styled.NewPatientSearchInput
placeholder = '환자 이메일을 입력하세요.'
/>
<styled.NewPatientSearchButton>
<styled.NewPatientSearchButtonImg />
</styled.NewPatientSearchButton>
</styled.NewPatientSearchWrapper>
<styled.NewPatientSearchResultWrapper>
🤔검색 결과가 없습니다.
</styled.NewPatientSearchResultWrapper>
<styled.NewPatientRegisterButtonWrapper>
<styled.NewPatientRegisterButton>
확인
</styled.NewPatientRegisterButton>
<styled.NewPatientRegisterButton>
취소
</styled.NewPatientRegisterButton>
</styled.NewPatientRegisterButtonWrapper>
</styled.ModalContent>
</styled.ModalContentWrapper>
<styled.ModalClsButtonWrapper/>
</styled.ModalContainer> : null
}
<styled.InfoAndSearchWrapper>
<styled.InfoWrapper>
{
props.info.infoType === 'DOCTOR' ?
<styled.InfoSquare>
<styled.InfoEachWrapper>
<styled.InfoEachTopic>분야</styled.InfoEachTopic>
<styled.InfoEachText>{props.info.doctorType}</styled.InfoEachText>
</styled.InfoEachWrapper>
<styled.InfoEachWrapper>
<styled.InfoEachTopic>이름</styled.InfoEachTopic>
<styled.InfoEachText>{props.info.userNm}</styled.InfoEachText>
</styled.InfoEachWrapper>
<styled.InfoEachWrapper>
<styled.InfoEachTopic>연락처</styled.InfoEachTopic>
<styled.InfoEachText>{props.info.contact}</styled.InfoEachText>
</styled.InfoEachWrapper>
</styled.InfoSquare> :
<styled.InfoSquare>
<styled.EditPatientInfoButton>
<styled.EditPatientInfoButtonImg />
<styled.EditPatientInfoButtonText>수정</styled.EditPatientInfoButtonText>
</styled.EditPatientInfoButton>
<styled.InfoEachWrapper>
<styled.InfoEachTopic>이름</styled.InfoEachTopic>
<styled.InfoEachText>{props.info.userNm}</styled.InfoEachText>
</styled.InfoEachWrapper>
<styled.InfoEachWrapper>
<styled.InfoEachTopic>생년월일</styled.InfoEachTopic>
<styled.InfoEachText>{props.info.userAge}세</styled.InfoEachText>
</styled.InfoEachWrapper>
<styled.InfoEachWrapper>
<styled.InfoEachTopic>연락처</styled.InfoEachTopic>
<styled.InfoEachText>{props.info.contact}</styled.InfoEachText>
</styled.InfoEachWrapper>
<styled.InfoEachWrapper
style = {{margin : '10px 0 0 0'}}
>
<styled.InfoEachTopic>환자 기록</styled.InfoEachTopic>
<styled.PatientInfo>
{
props.info.patientInfo.split('\n\n').map((patientInfoText : string) => {
return (
<div key = {patientInfoText}>
{patientInfoText}<br/><br/>
</div>
)
})
}
</styled.PatientInfo>
</styled.InfoEachWrapper>
</styled.InfoSquare>
}
<styled.NewPatientButton
onClick = {() => props.setEditModal(true)}
>
새 환자 등록
</styled.NewPatientButton>
</styled.InfoWrapper>
<styled.SearchAndDetailWrapper>
<styled.SearchBarWrapper>
<styled.SearchBar
placeholder = '환자 정보(이름, 이메일, 휴대폰 번호)'
value = {props.searchPatientKeyword}
onChange = {props.onSetKeyword}
/>
<styled.SearchButton>
검색
</styled.SearchButton>
<styled.SearchButton
onClick = {props.onInitialize}
>
초기화
</styled.SearchButton>
</styled.SearchBarWrapper>
<styled.SearchResultWrapper>
<styled.SearchResultInfo>
<styled.SearchResultInfoEach isLast = {false}>이름</styled.SearchResultInfoEach>
<styled.SearchResultInfoEach isLast = {false}>생년월일</styled.SearchResultInfoEach>
<styled.SearchResultInfoEach isLast = {true}>연락처</styled.SearchResultInfoEach>
</styled.SearchResultInfo>
{
props.filteringPatientList.length ?
props.filteringPatientList.map(patient => {
return (
<styled.SearchResultEach
key = {patient._id}
onClick = {() => props.onFetchPatientDetail(patient.userId)}
>
<styled.SearchResultEachText isLast = {false}>{patient.userNm}</styled.SearchResultEachText>
<styled.SearchResultEachText isLast = {false}>{patient.userAge}세</styled.SearchResultEachText>
<styled.SearchResultEachText isLast = {true}>{patient.contact}</styled.SearchResultEachText>
</styled.SearchResultEach>
)
}) :
<styled.NothingWrapper>
🤔검색 결과가 없습니다.
</styled.NothingWrapper>
}
</styled.SearchResultWrapper>
</styled.SearchAndDetailWrapper>
</styled.InfoAndSearchWrapper>
<styled.BottleListWrapper>
{
props.patientDetail && props.patientDetail.bottleList ?
props.patientDetail.bottleList.map((bottle : any) => {
return (
<styled.EachBottleWrapper
key = {bottle._id}
>
{
bottle.bottleId
}
</styled.EachBottleWrapper>
)
}) :
<styled.NothingWrapper>
🤔먼저 환자를 선택하세요.
</styled.NothingWrapper>
}
</styled.BottleListWrapper>
</styled.Container>
)
};
export default DoctorMenuPresenter;