@daeryun/dr_components 0.2.73 → 0.2.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/asset/images/myCase/arrow_2.webp +0 -0
  2. package/dist/asset/images/myCase/arrow_b.webp +0 -0
  3. package/dist/asset/images/myCase/arrow_b_w.webp +0 -0
  4. package/dist/asset/images/myCase/arrow_right.webp +0 -0
  5. package/dist/asset/images/myCase/background.svg +8 -0
  6. package/dist/asset/images/myCase/background.webp +0 -0
  7. package/dist/asset/images/myCase/background_mo.webp +0 -0
  8. package/dist/asset/images/myCase/background_tb.webp +0 -0
  9. package/dist/asset/images/myCase/home.svg +16 -0
  10. package/dist/asset/images/myCase/home.webp +0 -0
  11. package/dist/asset/images/myCase/icon/case_icon1.webp +0 -0
  12. package/dist/asset/images/myCase/icon/case_icon2.webp +0 -0
  13. package/dist/asset/images/myCase/icon/case_icon3.webp +0 -0
  14. package/dist/asset/images/myCase/icon/case_icon4.webp +0 -0
  15. package/dist/asset/images/myCase/icon/case_icon5.webp +0 -0
  16. package/dist/asset/images/myCase/icon/case_lookup_linkout.webp +0 -0
  17. package/dist/asset/images/myCase/icon/check_circle.webp +0 -0
  18. package/dist/asset/images/myCase/icon/check_circle2.webp +0 -0
  19. package/dist/asset/images/myCase/icon/client.webp +0 -0
  20. package/dist/asset/images/myCase/icon/close.webp +0 -0
  21. package/dist/asset/images/myCase/icon/daeryun.webp +0 -0
  22. package/dist/asset/images/myCase/icon/docs.webp +0 -0
  23. package/dist/asset/images/myCase/icon/download.webp +0 -0
  24. package/dist/asset/images/myCase/icon/hwp.webp +0 -0
  25. package/dist/asset/images/myCase/icon/ink_pen.webp +0 -0
  26. package/dist/asset/images/myCase/icon/jpg.webp +0 -0
  27. package/dist/asset/images/myCase/icon/modal_icon.webp +0 -0
  28. package/dist/asset/images/myCase/icon/pdf.webp +0 -0
  29. package/dist/asset/images/myCase/icon/png.webp +0 -0
  30. package/dist/asset/images/myCase/icon/unknown.webp +0 -0
  31. package/dist/asset/images/myCase/icon/word.webp +0 -0
  32. package/dist/asset/images/myCase/icon/xls.webp +0 -0
  33. package/dist/asset/images/myCase/nav_arr.webp +0 -0
  34. package/dist/asset/images/myCase/pagination/arrow_l_off.webp +0 -0
  35. package/dist/asset/images/myCase/pagination/arrow_l_on.webp +0 -0
  36. package/dist/asset/images/myCase/pagination/arrow_r_off.webp +0 -0
  37. package/dist/asset/images/myCase/pagination/arrow_r_on.webp +0 -0
  38. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  39. package/dist/components/BrochureBtn/BrochureBtn.d.ts +1 -0
  40. package/dist/components/BrochureBtn/BrochureBtn.stories.d.ts +6 -5
  41. package/dist/components/BrochureBtn/MedicalBrochureBtn.d.ts +1 -0
  42. package/dist/components/Fix/Fix.stories.d.ts +3 -2
  43. package/dist/components/Footer/TopBtn.d.ts +1 -0
  44. package/dist/components/MapSection/Map.d.ts +1 -0
  45. package/dist/components/MapSection/MapSection.d.ts +1 -1
  46. package/dist/components/Mark/Mark.d.ts +1 -0
  47. package/dist/components/SelectBox/SelectBox.d.ts +8 -8
  48. package/dist/components/Seo/SeoStrength.stories.d.ts +1 -0
  49. package/dist/components/ViewMoreSection/SearchIcon.d.ts +1 -0
  50. package/dist/components/banner/TopBanner.d.ts +1 -0
  51. package/dist/components/banner/TopBanner.stories.d.ts +1 -0
  52. package/dist/components/categoryView/CategoryComponent.d.ts +1 -1
  53. package/dist/components/page/Choice/Choice.d.ts +1 -1
  54. package/dist/components/page/MyCase/MyCase.stories.d.ts +6 -0
  55. package/dist/components/page/MyCase/MyCase.stories.jsx +17 -0
  56. package/dist/components/page/MyCase/MyCase.stories.tsx +25 -0
  57. package/dist/components/page/MyCase/MyCaseApp.d.ts +3 -0
  58. package/dist/components/page/MyCase/MyCaseApp.jsx +26 -0
  59. package/dist/components/page/MyCase/MyCaseApp.tsx +36 -0
  60. package/dist/components/page/MyCase/MyCasePage.d.ts +3 -0
  61. package/dist/components/page/MyCase/MyCasePage.jsx +23 -0
  62. package/dist/components/page/MyCase/MyCasePage.tsx +34 -0
  63. package/dist/components/page/MyCase/[id]/MyCaseDetail.stories.d.ts +6 -0
  64. package/dist/components/page/MyCase/[id]/MyCaseDetail.stories.jsx +17 -0
  65. package/dist/components/page/MyCase/[id]/MyCaseDetail.stories.tsx +25 -0
  66. package/dist/components/page/MyCase/[id]/MyCaseDetailApp.d.ts +3 -0
  67. package/dist/components/page/MyCase/[id]/MyCaseDetailApp.jsx +68 -0
  68. package/dist/components/page/MyCase/[id]/MyCaseDetailApp.tsx +159 -0
  69. package/dist/components/page/MyCase/[id]/MyCaseDetailPage.d.ts +3 -0
  70. package/dist/components/page/MyCase/[id]/MyCaseDetailPage.jsx +68 -0
  71. package/dist/components/page/MyCase/[id]/MyCaseDetailPage.tsx +159 -0
  72. package/dist/components/page/MyCase/[id]/_component/ContactInfo.d.ts +3 -0
  73. package/dist/components/page/MyCase/[id]/_component/ContactInfo.jsx +79 -0
  74. package/dist/components/page/MyCase/[id]/_component/ContactInfo.tsx +102 -0
  75. package/dist/components/page/MyCase/[id]/_component/DetailInfo.d.ts +7 -0
  76. package/dist/components/page/MyCase/[id]/_component/DetailInfo.jsx +44 -0
  77. package/dist/components/page/MyCase/[id]/_component/DetailInfo.tsx +94 -0
  78. package/dist/components/page/MyCase/[id]/_component/TimeLine.d.ts +7 -0
  79. package/dist/components/page/MyCase/[id]/_component/TimeLine.jsx +46 -0
  80. package/dist/components/page/MyCase/[id]/_component/TimeLine.tsx +72 -0
  81. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.d.ts +12 -0
  82. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.jsx +80 -0
  83. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.tsx +188 -0
  84. package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +7 -0
  85. package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +35 -0
  86. package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +59 -0
  87. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.d.ts +7 -0
  88. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +76 -0
  89. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +94 -0
  90. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.d.ts +8 -0
  91. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.jsx +107 -0
  92. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryAddModal.tsx +150 -0
  93. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.d.ts +8 -0
  94. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.jsx +25 -0
  95. package/dist/components/page/MyCase/[id]/_component/_modal/CaseInquiryConfirmModal.tsx +55 -0
  96. package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.d.ts +8 -0
  97. package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.jsx +26 -0
  98. package/dist/components/page/MyCase/[id]/_component/_modal/ModalCotainer.tsx +39 -0
  99. package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.d.ts +8 -0
  100. package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.jsx +4 -0
  101. package/dist/components/page/MyCase/[id]/_component/_textarea/TextArea.tsx +24 -0
  102. package/dist/components/page/MyCase/_actions/action.d.ts +35 -0
  103. package/dist/components/page/MyCase/_actions/action.js +145 -0
  104. package/dist/components/page/MyCase/_actions/action.ts +165 -0
  105. package/dist/components/page/MyCase/_component/CaseAppContainer.d.ts +3 -0
  106. package/dist/components/page/MyCase/_component/CaseAppContainer.jsx +110 -0
  107. package/dist/components/page/MyCase/_component/CaseAppContainer.tsx +247 -0
  108. package/dist/components/page/MyCase/_component/CasePageContainer.d.ts +3 -0
  109. package/dist/components/page/MyCase/_component/CasePageContainer.jsx +119 -0
  110. package/dist/components/page/MyCase/_component/CasePageContainer.tsx +256 -0
  111. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuApp.d.ts +8 -0
  112. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuApp.jsx +47 -0
  113. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuApp.tsx +77 -0
  114. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuPage.d.ts +8 -0
  115. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuPage.jsx +47 -0
  116. package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenuPage.tsx +77 -0
  117. package/dist/components/page/MyCase/_component/_button/Badge.d.ts +15 -0
  118. package/dist/components/page/MyCase/_component/_button/Badge.jsx +16 -0
  119. package/dist/components/page/MyCase/_component/_button/Badge.tsx +22 -0
  120. package/dist/components/page/MyCase/_component/_button/SubColor1Button.d.ts +8 -0
  121. package/dist/components/page/MyCase/_component/_button/SubColor1Button.jsx +9 -0
  122. package/dist/components/page/MyCase/_component/_button/SubColor1Button.tsx +33 -0
  123. package/dist/components/page/MyCase/_component/_button/SubMenuButton.d.ts +8 -0
  124. package/dist/components/page/MyCase/_component/_button/SubMenuButton.jsx +9 -0
  125. package/dist/components/page/MyCase/_component/_button/SubMenuButton.tsx +31 -0
  126. package/dist/components/page/MyCase/_component/_empty/EmptyTable.d.ts +7 -0
  127. package/dist/components/page/MyCase/_component/_empty/EmptyTable.jsx +75 -0
  128. package/dist/components/page/MyCase/_component/_empty/EmptyTable.tsx +85 -0
  129. package/dist/components/page/MyCase/_component/_layout/CaseLayout.d.ts +8 -0
  130. package/dist/components/page/MyCase/_component/_layout/CaseLayout.jsx +11 -0
  131. package/dist/components/page/MyCase/_component/_layout/CaseLayout.tsx +29 -0
  132. package/dist/components/page/MyCase/_component/_layout/CaseWrapper.d.ts +12 -0
  133. package/dist/components/page/MyCase/_component/_layout/CaseWrapper.jsx +25 -0
  134. package/dist/components/page/MyCase/_component/_layout/CaseWrapper.tsx +41 -0
  135. package/dist/components/page/MyCase/_component/_layout/HeaderLayout.d.ts +5 -0
  136. package/dist/components/page/MyCase/_component/_layout/HeaderLayout.jsx +4 -0
  137. package/dist/components/page/MyCase/_component/_layout/HeaderLayout.tsx +5 -0
  138. package/dist/components/page/MyCase/_component/_layout/IntroWrapper.d.ts +11 -0
  139. package/dist/components/page/MyCase/_component/_layout/IntroWrapper.jsx +31 -0
  140. package/dist/components/page/MyCase/_component/_layout/IntroWrapper.tsx +81 -0
  141. package/dist/components/page/MyCase/_component/_loading/Loading.d.ts +3 -0
  142. package/dist/components/page/MyCase/_component/_loading/Loading.jsx +89 -0
  143. package/dist/components/page/MyCase/_component/_loading/Loading.tsx +92 -0
  144. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentApp.d.ts +10 -0
  145. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentApp.jsx +82 -0
  146. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentApp.tsx +137 -0
  147. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentPage.d.ts +10 -0
  148. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentPage.jsx +81 -0
  149. package/dist/components/page/MyCase/_component/_pagination/PaginationComponentPage.tsx +135 -0
  150. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.d.ts +9 -0
  151. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.jsx +65 -0
  152. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.tsx +79 -0
  153. package/dist/components/page/MyCase/_component/_table/CaseTable.d.ts +10 -0
  154. package/dist/components/page/MyCase/_component/_table/CaseTable.jsx +63 -0
  155. package/dist/components/page/MyCase/_component/_table/CaseTable.tsx +94 -0
  156. package/dist/components/page/MyCase/_component/_table/CaseTableMo.d.ts +10 -0
  157. package/dist/components/page/MyCase/_component/_table/CaseTableMo.jsx +11 -0
  158. package/dist/components/page/MyCase/_component/_table/CaseTableMo.tsx +28 -0
  159. package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.d.ts +6 -0
  160. package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.jsx +35 -0
  161. package/dist/components/page/MyCase/_component/_table/CaseTableMoBox.tsx +43 -0
  162. package/dist/components/page/MyCase/_component/_table/CaseTableMoPage.d.ts +10 -0
  163. package/dist/components/page/MyCase/_component/_table/CaseTableMoPage.jsx +11 -0
  164. package/dist/components/page/MyCase/_component/_table/CaseTableMoPage.tsx +28 -0
  165. package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.d.ts +6 -0
  166. package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.js +31 -0
  167. package/dist/components/page/MyCase/_fetchers/addMyCaseQuestion.ts +22 -0
  168. package/dist/components/page/MyCase/_fetchers/getCase.d.ts +5 -0
  169. package/dist/components/page/MyCase/_fetchers/getCase.js +30 -0
  170. package/dist/components/page/MyCase/_fetchers/getCase.ts +21 -0
  171. package/dist/components/page/MyCase/_fetchers/getCaseList.d.ts +7 -0
  172. package/dist/components/page/MyCase/_fetchers/getCaseList.js +30 -0
  173. package/dist/components/page/MyCase/_fetchers/getCaseList.ts +24 -0
  174. package/dist/components/page/MyCase/_fetchers/getCourtFileList.d.ts +5 -0
  175. package/dist/components/page/MyCase/_fetchers/getCourtFileList.js +30 -0
  176. package/dist/components/page/MyCase/_fetchers/getCourtFileList.ts +21 -0
  177. package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.d.ts +7 -0
  178. package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.js +30 -0
  179. package/dist/components/page/MyCase/_fetchers/getMyCaseQuestion.ts +24 -0
  180. package/dist/components/page/MyCase/_fetchers/getMyFileList.d.ts +5 -0
  181. package/dist/components/page/MyCase/_fetchers/getMyFileList.js +30 -0
  182. package/dist/components/page/MyCase/_fetchers/getMyFileList.ts +21 -0
  183. package/dist/components/page/MyCase/_fetchers/getTimeLine.d.ts +5 -0
  184. package/dist/components/page/MyCase/_fetchers/getTimeLine.js +30 -0
  185. package/dist/components/page/MyCase/_fetchers/getTimeLine.ts +21 -0
  186. package/dist/components/page/MyCase/_lib/catagoryMenuName.d.ts +8 -0
  187. package/dist/components/page/MyCase/_lib/catagoryMenuName.js +8 -0
  188. package/dist/components/page/MyCase/_lib/catagoryMenuName.ts +11 -0
  189. package/dist/components/page/MyCase/_lib/pagination/locale/ko_KR.d.ts +15 -0
  190. package/dist/components/page/MyCase/_lib/pagination/locale/ko_KR.js +21 -0
  191. package/dist/components/page/MyCase/_type/type.d.ts +73 -0
  192. package/dist/components/page/MyCase/_type/type.js +1 -0
  193. package/dist/components/page/MyCase/_type/type.ts +81 -0
  194. package/dist/components/page/Strength/Strength.d.ts +1 -0
  195. package/dist/components/page/index.d.ts +4 -0
  196. package/dist/components/page/index.js +4 -0
  197. package/dist/components/page/index.ts +4 -0
  198. package/dist/lib/utils.js +4 -4
  199. package/dist/styles/globals.css +2087 -130
  200. package/dist/tsconfig.tsbuildinfo +1 -1
  201. package/package.json +1 -1
@@ -0,0 +1,107 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import Image from 'next/image';
11
+ import ModalContainer from './ModalCotainer';
12
+ import TextArea from '../_textarea/TextArea';
13
+ import { useState } from 'react';
14
+ import { usePostMyCaseQuestion } from '../../../_actions/action';
15
+ import Loading from '../../../_component/_loading/Loading';
16
+ import CaseInquiryConfirmModal from './CaseInquiryConfirmModal';
17
+ import close from '../../../../../../asset/images/myCase/icon/close.webp';
18
+ const CaseInquiryAddModal = ({ isOpen, onClose, id, refetch }) => {
19
+ const [value, setValue] = useState('');
20
+ const [isCheck, setIsCheck] = useState(false);
21
+ const [isOpenConfirm, setIsOpenConfirm] = useState(false);
22
+ const { mutateAsync, isLoading } = usePostMyCaseQuestion(id, value);
23
+ // console.log(isLoading);
24
+ return (<>
25
+ <ModalContainer isOpen={isOpen} onClose={() => {
26
+ setValue('');
27
+ setIsCheck(false);
28
+ onClose();
29
+ }}>
30
+ <div className="border-grayScale4 bg-grayScale8 sm-top:max-h-[786px] sm-top:w-[calc(100%-60px)] sm-top:max-w-[780px] sm-top:rounded-[32px] sm-top:p-[52px] absolute h-full max-h-[568px] w-[calc(100%-40px)] overflow-y-auto rounded-[16px] border border-solid p-[32px] lg:h-full lg:max-h-[1000px] lg:w-full lg:max-w-[1000px] " onClick={e => e.stopPropagation()}>
31
+ <div className="flex flex-row items-center justify-between">
32
+ <p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">
33
+ 사건문의 작성
34
+ </p>
35
+ <Image src={close} alt="close" width={24} height={24} onClick={() => {
36
+ setValue('');
37
+ setIsCheck(false);
38
+ onClose();
39
+ }} className="sm-top:h-[20px] sm-top:w-[20px] h-[16px] w-[16px] cursor-pointer lg:h-[24px] lg:w-[24px]"/>
40
+ </div>
41
+ <div className="sm-top:mt-[20px] mt-[12px]">
42
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 max-sm-top:hidden text-black">
43
+ 본 사건에 대해 궁금하신 점이 있다면 작성해 주세요.
44
+ </p>
45
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 max-sm-top:hidden text-black">
46
+ 담당자가 확인하여 성심껏 답변해 드리겠습니다!
47
+ </p>
48
+ <p className="body_large2_mo sm-top:hidden">
49
+ 본 사건에 대해 궁금하신 점이 있다면 작성해 주세요. 담당자가 확인하여 성심껏 답변해
50
+ 드리겠습니다!
51
+ </p>
52
+ </div>
53
+ <div className="mt-[16px] flex flex-row items-center justify-between">
54
+ <div className="sm-top:gap-[8px] flex flex-row items-center justify-center gap-[4px]">
55
+ <p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1 text-black">
56
+ 문의내용
57
+ </p>
58
+ <p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-grayScale3">
59
+ (30자 이상<span className="text-mycaseMainColor"> *</span>)
60
+ </p>
61
+ </div>
62
+ <div className="">
63
+ <p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-black">
64
+ <span className="text-mycaseMainColor">{value.length}</span> / 1,000
65
+ </p>
66
+ </div>
67
+ </div>
68
+ <div className="sm-top:mt-[15px] mt-[12px] lg:mt-[18px]">
69
+ <TextArea placeholder="문의내용을 입력해 주세요." value={value} onChange={e => setValue(e.target.value)} isCheck={isCheck}/>
70
+ </div>
71
+ {isCheck && (<div className=" mt-[8px]">
72
+ <p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor">
73
+ *문의내용은 최소 30자 이상으로 입력해 주세요.
74
+ </p>
75
+ </div>)}
76
+
77
+ {isLoading ? (<div className="absolute top-[0] flex h-full w-full items-center justify-center">
78
+ <Loading />
79
+ </div>) : (<></>)}
80
+ <div className={`${isCheck
81
+ ? 'sm-top:mt-[20px] mt-[21px] lg:mt-[16px]'
82
+ : 'sm-top:mt-[55px] mt-[50px] lg:mt-[53px]'}`}>
83
+ <button className={`sm-top:h-[60px] sm-top:w-full sm-top:rounded-[8px] flex h-[48px] w-full items-center justify-center rounded-[4px] lg:h-[72px] lg:w-[896px] lg:rounded-[16px] ${value.length >= 30 ? ' bg-grayScale1 text-white' : 'bg-grayScale6 text-grayScale3 '}`} onClick={() => __awaiter(void 0, void 0, void 0, function* () {
84
+ if (value.length >= 30) {
85
+ setIsCheck(false);
86
+ const result = yield mutateAsync();
87
+ if (result) {
88
+ refetch();
89
+ setValue('');
90
+ window.scrollTo(0, 0);
91
+ setIsOpenConfirm(true);
92
+ }
93
+ onClose();
94
+ }
95
+ else {
96
+ setIsCheck(true);
97
+ }
98
+ })}>
99
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">문의하기</p>
100
+ </button>
101
+ </div>
102
+ </div>
103
+ </ModalContainer>
104
+ <CaseInquiryConfirmModal isOpen={isOpenConfirm} onClose={() => setIsOpenConfirm(false)} id={id} refetch={refetch}/>
105
+ </>);
106
+ };
107
+ export default CaseInquiryAddModal;
@@ -0,0 +1,150 @@
1
+ import Image from 'next/image';
2
+ import ModalContainer from './ModalCotainer';
3
+ import TextArea from '../_textarea/TextArea';
4
+ import { useEffect, useState } from 'react';
5
+ import { usePostMyCaseQuestion } from '../../../_actions/action';
6
+ import Loading from '../../../_component/_loading/Loading';
7
+ import CaseInquiryConfirmModal from './CaseInquiryConfirmModal';
8
+ import close from '../../../../../../asset/images/myCase/icon/close.webp';
9
+ const CaseInquiryAddModal = ({
10
+ isOpen,
11
+ onClose,
12
+ id,
13
+ refetch
14
+ }: {
15
+ isOpen: boolean;
16
+ onClose: () => void;
17
+ id: string;
18
+ refetch: () => void;
19
+ }) => {
20
+ const [value, setValue] = useState('');
21
+ const [isCheck, setIsCheck] = useState(false);
22
+ const [isOpenConfirm, setIsOpenConfirm] = useState(false);
23
+
24
+ const { mutateAsync, isLoading } = usePostMyCaseQuestion(id, value);
25
+ // console.log(isLoading);
26
+ return (
27
+ <>
28
+ <ModalContainer
29
+ isOpen={isOpen}
30
+ onClose={() => {
31
+ setValue('');
32
+ setIsCheck(false);
33
+ onClose();
34
+ }}
35
+ >
36
+ <div
37
+ className="border-grayScale4 bg-grayScale8 sm-top:max-h-[786px] sm-top:w-[calc(100%-60px)] sm-top:max-w-[780px] sm-top:rounded-[32px] sm-top:p-[52px] absolute h-full max-h-[568px] w-[calc(100%-40px)] overflow-y-auto rounded-[16px] border border-solid p-[32px] lg:h-full lg:max-h-[1000px] lg:w-full lg:max-w-[1000px] "
38
+ onClick={e => e.stopPropagation()}
39
+ >
40
+ <div className="flex flex-row items-center justify-between">
41
+ <p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">
42
+ 사건문의 작성
43
+ </p>
44
+ <Image
45
+ src={close}
46
+ alt="close"
47
+ width={24}
48
+ height={24}
49
+ onClick={() => {
50
+ setValue('');
51
+ setIsCheck(false);
52
+ onClose();
53
+ }}
54
+ className="sm-top:h-[20px] sm-top:w-[20px] h-[16px] w-[16px] cursor-pointer lg:h-[24px] lg:w-[24px]"
55
+ />
56
+ </div>
57
+ <div className="sm-top:mt-[20px] mt-[12px]">
58
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 max-sm-top:hidden text-black">
59
+ 본 사건에 대해 궁금하신 점이 있다면 작성해 주세요.
60
+ </p>
61
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 max-sm-top:hidden text-black">
62
+ 담당자가 확인하여 성심껏 답변해 드리겠습니다!
63
+ </p>
64
+ <p className="body_large2_mo sm-top:hidden">
65
+ 본 사건에 대해 궁금하신 점이 있다면 작성해 주세요. 담당자가 확인하여 성심껏 답변해
66
+ 드리겠습니다!
67
+ </p>
68
+ </div>
69
+ <div className="mt-[16px] flex flex-row items-center justify-between">
70
+ <div className="sm-top:gap-[8px] flex flex-row items-center justify-center gap-[4px]">
71
+ <p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1 text-black">
72
+ 문의내용
73
+ </p>
74
+ <p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-grayScale3">
75
+ (30자 이상<span className="text-mycaseMainColor"> *</span>)
76
+ </p>
77
+ </div>
78
+ <div className="">
79
+ <p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-black">
80
+ <span className="text-mycaseMainColor">{value.length}</span> / 1,000
81
+ </p>
82
+ </div>
83
+ </div>
84
+ <div className="sm-top:mt-[15px] mt-[12px] lg:mt-[18px]">
85
+ <TextArea
86
+ placeholder="문의내용을 입력해 주세요."
87
+ value={value}
88
+ onChange={e => setValue(e.target.value)}
89
+ isCheck={isCheck}
90
+ />
91
+ </div>
92
+ {isCheck && (
93
+ <div className=" mt-[8px]">
94
+ <p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor">
95
+ *문의내용은 최소 30자 이상으로 입력해 주세요.
96
+ </p>
97
+ </div>
98
+ )}
99
+
100
+ {isLoading ? (
101
+ <div className="absolute top-[0] flex h-full w-full items-center justify-center">
102
+ <Loading />
103
+ </div>
104
+ ) : (
105
+ <></>
106
+ )}
107
+ <div
108
+ className={`${
109
+ isCheck
110
+ ? 'sm-top:mt-[20px] mt-[21px] lg:mt-[16px]'
111
+ : 'sm-top:mt-[55px] mt-[50px] lg:mt-[53px]'
112
+ }`}
113
+ >
114
+ <button
115
+ className={`sm-top:h-[60px] sm-top:w-full sm-top:rounded-[8px] flex h-[48px] w-full items-center justify-center rounded-[4px] lg:h-[72px] lg:w-[896px] lg:rounded-[16px] ${
116
+ value.length >= 30 ? ' bg-grayScale1 text-white' : 'bg-grayScale6 text-grayScale3 '
117
+ }`}
118
+ onClick={async () => {
119
+ if (value.length >= 30) {
120
+ setIsCheck(false);
121
+
122
+ const result = await mutateAsync();
123
+ if (result) {
124
+ refetch();
125
+ setValue('');
126
+ window.scrollTo(0, 0);
127
+ setIsOpenConfirm(true);
128
+ }
129
+ onClose();
130
+ } else {
131
+ setIsCheck(true);
132
+ }
133
+ }}
134
+ >
135
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">문의하기</p>
136
+ </button>
137
+ </div>
138
+ </div>
139
+ </ModalContainer>
140
+ <CaseInquiryConfirmModal
141
+ isOpen={isOpenConfirm}
142
+ onClose={() => setIsOpenConfirm(false)}
143
+ id={id}
144
+ refetch={refetch}
145
+ />
146
+ </>
147
+ );
148
+ };
149
+
150
+ export default CaseInquiryAddModal;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare const CaseInquiryConfirmModal: ({ isOpen, onClose, id, refetch }: {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ id: string;
6
+ refetch: () => void;
7
+ }) => import("react").JSX.Element;
8
+ export default CaseInquiryConfirmModal;
@@ -0,0 +1,25 @@
1
+ import Image from 'next/image';
2
+ import ModalContainer from './ModalCotainer';
3
+ import modalIcon from '../../../../../../asset/images/myCase/icon/modal_icon.webp';
4
+ const CaseInquiryConfirmModal = ({ isOpen, onClose, id, refetch }) => {
5
+ // console.log(isLoading);
6
+ return (<ModalContainer isOpen={isOpen} onClose={() => {
7
+ onClose();
8
+ }}>
9
+ <div className="border-grayScale4 bg-grayScale8 sm-top:w-[calc(100%-252px)] sm-top:max-w-[648px] sm-top:rounded-[24px] sm-top:px-[52px] sm-top:py-[44px] absolute flex w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[12px] border border-solid p-[30px] lg:w-full lg:max-w-[804px] lg:p-[52px] " onClick={e => e.stopPropagation()}>
10
+ <Image src={modalIcon} alt="check" width={40} height={48.9} className="sm-top:h-[68.44px] sm-top:w-[56px] h-[48.9px] w-[40px] lg:h-[88px] lg:w-[72px]"/>
11
+ <p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 sm-top:mt-[20px] mt-[16.11px] lg:mt-[36px]">
12
+ 사건문의 작성이 완료되었습니다.
13
+ </p>
14
+ <p className="body_medium2_mo sm-top:body_medium2_tb lg:body_medium2 text-grayScale3 sm-top:mt-[16px] mt-[8px] text-center lg:mt-[20px]">
15
+ 문의에 대한 답변은 평균 1일 정도 소요될 예정입니다.
16
+ </p>
17
+ <button className={`bg-grayScale1 sm-top:mt-[40px] sm-top:h-[60px] sm-top:rounded-[8px] mt-[20px] h-[48px] w-full rounded-[4px] lg:mt-[47px] lg:h-[72px] lg:rounded-[16px] `} onClick={() => {
18
+ onClose();
19
+ }}>
20
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">확인</p>
21
+ </button>
22
+ </div>
23
+ </ModalContainer>);
24
+ };
25
+ export default CaseInquiryConfirmModal;
@@ -0,0 +1,55 @@
1
+ import Image from 'next/image';
2
+ import ModalContainer from './ModalCotainer';
3
+
4
+ import modalIcon from '../../../../../../asset/images/myCase/icon/modal_icon.webp';
5
+
6
+ const CaseInquiryConfirmModal = ({
7
+ isOpen,
8
+ onClose,
9
+ id,
10
+ refetch
11
+ }: {
12
+ isOpen: boolean;
13
+ onClose: () => void;
14
+ id: string;
15
+ refetch: () => void;
16
+ }) => {
17
+ // console.log(isLoading);
18
+ return (
19
+ <ModalContainer
20
+ isOpen={isOpen}
21
+ onClose={() => {
22
+ onClose();
23
+ }}
24
+ >
25
+ <div
26
+ className="border-grayScale4 bg-grayScale8 sm-top:w-[calc(100%-252px)] sm-top:max-w-[648px] sm-top:rounded-[24px] sm-top:px-[52px] sm-top:py-[44px] absolute flex w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[12px] border border-solid p-[30px] lg:w-full lg:max-w-[804px] lg:p-[52px] "
27
+ onClick={e => e.stopPropagation()}
28
+ >
29
+ <Image
30
+ src={modalIcon}
31
+ alt="check"
32
+ width={40}
33
+ height={48.9}
34
+ className="sm-top:h-[68.44px] sm-top:w-[56px] h-[48.9px] w-[40px] lg:h-[88px] lg:w-[72px]"
35
+ />
36
+ <p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 sm-top:mt-[20px] mt-[16.11px] lg:mt-[36px]">
37
+ 사건문의 작성이 완료되었습니다.
38
+ </p>
39
+ <p className="body_medium2_mo sm-top:body_medium2_tb lg:body_medium2 text-grayScale3 sm-top:mt-[16px] mt-[8px] text-center lg:mt-[20px]">
40
+ 문의에 대한 답변은 평균 1일 정도 소요될 예정입니다.
41
+ </p>
42
+ <button
43
+ className={`bg-grayScale1 sm-top:mt-[40px] sm-top:h-[60px] sm-top:rounded-[8px] mt-[20px] h-[48px] w-full rounded-[4px] lg:mt-[47px] lg:h-[72px] lg:rounded-[16px] `}
44
+ onClick={() => {
45
+ onClose();
46
+ }}
47
+ >
48
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">확인</p>
49
+ </button>
50
+ </div>
51
+ </ModalContainer>
52
+ );
53
+ };
54
+
55
+ export default CaseInquiryConfirmModal;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface ModalContainerProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ children: React.ReactNode;
6
+ }
7
+ declare const ModalContainer: React.FC<ModalContainerProps>;
8
+ export default ModalContainer;
@@ -0,0 +1,26 @@
1
+ import { useEffect } from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ const ModalContainer = ({ isOpen, onClose, children }) => {
4
+ useEffect(() => {
5
+ // 모달이 열릴 때 스크롤 방지
6
+ if (isOpen) {
7
+ document.body.style.overflow = 'hidden';
8
+ }
9
+ else {
10
+ document.body.style.overflow = 'unset';
11
+ }
12
+ return () => {
13
+ document.body.style.overflow = 'unset'; // 컴포넌트 언마운트 시 스크롤 복원
14
+ };
15
+ }, [isOpen]);
16
+ return ReactDOM.createPortal(isOpen && (<div className="fixed inset-0 z-[9999] flex items-center justify-center bg-[#3D3D3DCC] " // z-index를 높게 설정
17
+ onClick={onClose} // 배경 클릭 시 모달 닫기
18
+ >
19
+ <div className="flex items-center justify-center w-full h-full z-60" // z-index를 더 높게 설정
20
+ >
21
+ {children}
22
+ </div>
23
+ </div>), document.body // Portal을 사용하여 body에 렌더링
24
+ );
25
+ };
26
+ export default ModalContainer;
@@ -0,0 +1,39 @@
1
+ import { useEffect } from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ interface ModalContainerProps {
4
+ isOpen: boolean; // 모달 열림 상태
5
+ onClose: () => void; // 모달 닫기 함수
6
+ children: React.ReactNode;
7
+ }
8
+
9
+ const ModalContainer: React.FC<ModalContainerProps> = ({ isOpen, onClose, children }) => {
10
+ useEffect(() => {
11
+ // 모달이 열릴 때 스크롤 방지
12
+ if (isOpen) {
13
+ document.body.style.overflow = 'hidden';
14
+ } else {
15
+ document.body.style.overflow = 'unset';
16
+ }
17
+
18
+ return () => {
19
+ document.body.style.overflow = 'unset'; // 컴포넌트 언마운트 시 스크롤 복원
20
+ };
21
+ }, [isOpen]);
22
+ return ReactDOM.createPortal(
23
+ isOpen && (
24
+ <div
25
+ className="fixed inset-0 z-[9999] flex items-center justify-center bg-[#3D3D3DCC] " // z-index를 높게 설정
26
+ onClick={onClose} // 배경 클릭 시 모달 닫기
27
+ >
28
+ <div
29
+ className="flex items-center justify-center w-full h-full z-60" // z-index를 더 높게 설정
30
+ >
31
+ {children}
32
+ </div>
33
+ </div>
34
+ ),
35
+ document.body // Portal을 사용하여 body에 렌더링
36
+ );
37
+ };
38
+
39
+ export default ModalContainer;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare const TextArea: ({ placeholder, value, onChange, isCheck }: {
3
+ placeholder: string;
4
+ value: string;
5
+ onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
6
+ isCheck: boolean;
7
+ }) => import("react").JSX.Element;
8
+ export default TextArea;
@@ -0,0 +1,4 @@
1
+ const TextArea = ({ placeholder, value, onChange, isCheck }) => {
2
+ return (<textarea value={value} className={`body_medium2_mo sm-top:h-[368px] sm-top:p-[32px] sm-top:body_medium2_tb lg:body_medium2 h-[232px] w-full resize-none rounded-[10px] border border-solid p-[16px] placeholder:text-grayScale3 lg:h-[512px] lg:p-[36px] ${isCheck ? 'border-mycaseMainColor' : 'border-grayScale5'}`} placeholder={placeholder} onChange={onChange}/>);
3
+ };
4
+ export default TextArea;
@@ -0,0 +1,24 @@
1
+ const TextArea = ({
2
+ placeholder,
3
+ value,
4
+ onChange,
5
+ isCheck
6
+ }: {
7
+ placeholder: string;
8
+ value: string;
9
+ onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
10
+ isCheck: boolean;
11
+ }) => {
12
+ return (
13
+ <textarea
14
+ value={value}
15
+ className={`body_medium2_mo sm-top:h-[368px] sm-top:p-[32px] sm-top:body_medium2_tb lg:body_medium2 h-[232px] w-full resize-none rounded-[10px] border border-solid p-[16px] placeholder:text-grayScale3 lg:h-[512px] lg:p-[36px] ${
16
+ isCheck ? 'border-mycaseMainColor' : 'border-grayScale5'
17
+ }`}
18
+ placeholder={placeholder}
19
+ onChange={onChange}
20
+ />
21
+ );
22
+ };
23
+
24
+ export default TextArea;
@@ -0,0 +1,35 @@
1
+ import { FetchType, DetailList, TimeLineType, FileList, Question } from '../_type/type';
2
+ export declare const useGetCaseList: ({ tapState, subTapState, pageNumber, pageSize }: {
3
+ tapState: string;
4
+ subTapState: string;
5
+ pageNumber: number;
6
+ pageSize: number;
7
+ }) => {
8
+ data: any;
9
+ isLoading: boolean;
10
+ };
11
+ export declare const useGetDetailList: (id: string) => {
12
+ data: FetchType<DetailList> | undefined;
13
+ isLoading: boolean;
14
+ };
15
+ export declare const useGetTimeLine: (id: string) => {
16
+ data: FetchType<TimeLineType> | undefined;
17
+ isLoading: boolean;
18
+ };
19
+ export declare const useGetCourtFileList: (id: string) => {
20
+ data: FetchType<FileList[]> | undefined;
21
+ isLoading: boolean;
22
+ };
23
+ export declare const useGetMyFileList: (id: string) => {
24
+ data: FetchType<FileList[]> | undefined;
25
+ isLoading: boolean;
26
+ };
27
+ export declare const useGetMyCaseQuestion: (id: string, page: number, pageSize: number) => {
28
+ data: FetchType<Question[]> | undefined;
29
+ isLoading: boolean;
30
+ refetch: (options?: import("@tanstack/query-core/build/legacy/hydration-k2LfsAVL").aj | undefined) => Promise<import("@tanstack/query-core/build/legacy/hydration-k2LfsAVL").aA<FetchType<Question[]>, Error>>;
31
+ };
32
+ export declare const usePostMyCaseQuestion: (id: string, content: string) => {
33
+ mutateAsync: import("@tanstack/react-query/build/legacy/types").UseMutateAsyncFunction<FetchType<Question[]>, Error, void, unknown>;
34
+ isLoading: boolean;
35
+ };
@@ -0,0 +1,145 @@
1
+ 'use client';
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { useMutation, useQuery } from '@tanstack/react-query';
12
+ import getCase from '../_fetchers/getCase';
13
+ import getTimeLine from '../_fetchers/getTimeLine';
14
+ import getCourtFileList from '../_fetchers/getCourtFileList';
15
+ import getMyFileList from '../_fetchers/getMyFileList';
16
+ import getMyCaseQuestion from '../_fetchers/getMyCaseQuestion';
17
+ import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
18
+ import getCaseList from '../_fetchers/getCaseList';
19
+ const jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
20
+ // 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjMsImVtYWlsIjoiNjAzMDgwNEBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzQwNDQ2Nzg1LCJleHAiOjE3NDA0ODI3ODV9.v_d7htci4fjLA5MqBXWxUqyNjsAm2GEcdRBO5se-DB8'; //빈거
21
+ export const useGetCaseList = ({ tapState, subTapState, pageNumber, pageSize }) => {
22
+ const { data, isLoading } = useQuery({
23
+ queryKey: ['case', tapState, subTapState, pageNumber, pageSize],
24
+ queryFn: () => getCaseList({
25
+ jwt: jwt,
26
+ size: pageSize,
27
+ state: subTapState,
28
+ page: pageNumber
29
+ }),
30
+ //브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
31
+ refetchOnWindowFocus: false,
32
+ //기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
33
+ // cacheTime: 0,
34
+ gcTime: 0,
35
+ staleTime: 0
36
+ });
37
+ return { data, isLoading };
38
+ };
39
+ export const useGetDetailList = (id) => {
40
+ const { data, isLoading } = useQuery({
41
+ queryKey: ['case', id],
42
+ queryFn: () => getCase({
43
+ jwt: jwt,
44
+ id: id
45
+ }),
46
+ //브라우저 화면을 focus할 때 새로 api를 호출할 건지 설정하는 옵션
47
+ refetchOnWindowFocus: false,
48
+ //기본설정 cacheTime:5분, staleTime:0초, 값을 Infinity로 설정할 경우 api return 값이 바뀌지 않는 이상 서버에 새로 요청하지 않고 캐싱된 데이터를 영구적으로 사용하여 api 호출 최적화
49
+ gcTime: 0,
50
+ staleTime: 0,
51
+ enabled: !!id
52
+ // onSuccess: res => {},
53
+ // onError: error => {
54
+ // console.log(error);
55
+ // }
56
+ });
57
+ return { data, isLoading };
58
+ };
59
+ export const useGetTimeLine = (id) => {
60
+ const { data, isLoading } = useQuery({
61
+ queryKey: ['case', 'timeline', id],
62
+ queryFn: () => getTimeLine({
63
+ jwt: jwt,
64
+ id: id
65
+ }),
66
+ gcTime: 0,
67
+ staleTime: 0,
68
+ enabled: !!id
69
+ // onSuccess: res => {},
70
+ // onError: error => {
71
+ // console.log(error);
72
+ // }
73
+ });
74
+ return { data, isLoading };
75
+ };
76
+ export const useGetCourtFileList = (id) => {
77
+ const { data, isLoading } = useQuery({
78
+ queryKey: ['case', 'courtFileList', id],
79
+ queryFn: () => getCourtFileList({
80
+ jwt: jwt,
81
+ id: id
82
+ }),
83
+ gcTime: 0,
84
+ staleTime: 0,
85
+ enabled: !!id
86
+ // onSuccess: res => {},
87
+ // onError: error => {
88
+ // console.log(error);
89
+ // }
90
+ });
91
+ return { data, isLoading };
92
+ };
93
+ export const useGetMyFileList = (id) => {
94
+ const { data, isLoading } = useQuery({
95
+ queryKey: ['case', 'myFileList', id],
96
+ queryFn: () => getMyFileList({
97
+ jwt: jwt,
98
+ id: id
99
+ }),
100
+ gcTime: 0,
101
+ staleTime: 0,
102
+ enabled: !!id
103
+ // onSuccess: res => {},
104
+ // onError: error => {
105
+ // console.log(error);
106
+ // }
107
+ });
108
+ return { data, isLoading };
109
+ };
110
+ export const useGetMyCaseQuestion = (id, page, pageSize) => {
111
+ const { data, isLoading, refetch } = useQuery({
112
+ queryKey: ['case', 'myCaseQuestion', id, page, pageSize],
113
+ queryFn: () => getMyCaseQuestion({
114
+ jwt: jwt,
115
+ id: id,
116
+ page: page,
117
+ size: pageSize
118
+ }),
119
+ gcTime: 0,
120
+ staleTime: 0,
121
+ enabled: !!id
122
+ // onSuccess: res => {},
123
+ // onError: error => {
124
+ // console.log(error);
125
+ // }
126
+ });
127
+ return { data, isLoading, refetch };
128
+ };
129
+ export const usePostMyCaseQuestion = (id, content) => {
130
+ const { mutateAsync, status } = useMutation({
131
+ mutationFn: () => __awaiter(void 0, void 0, void 0, function* () {
132
+ return yield addMyCaseQuestion({
133
+ jwt: jwt,
134
+ id: id,
135
+ content: content
136
+ });
137
+ }),
138
+ onSuccess: res => { },
139
+ onError: error => {
140
+ console.log(error);
141
+ }
142
+ });
143
+ const isLoading = status === 'pending';
144
+ return { mutateAsync, isLoading };
145
+ };