@daeryun/dr_components 1.1.56 → 1.1.58

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 (93) hide show
  1. package/dist/asset/images/myCase//bfileViewer/download.webp +0 -0
  2. package/dist/asset/images/myCase//bfileViewer/rotate_ccw.webp +0 -0
  3. package/dist/asset/images/myCase//bfileViewer/zoom_in.webp +0 -0
  4. package/dist/asset/images/myCase//bfileViewer/zoom_out.webp +0 -0
  5. package/dist/asset/images/myCase/icon/arrow.webp +0 -0
  6. package/dist/asset/images/myCase/icon/chat.webp +0 -0
  7. package/dist/asset/images/myCase/icon/check_ok.webp +0 -0
  8. package/dist/asset/images/myCase/icon/search.webp +0 -0
  9. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  10. package/dist/components/Daeryuntalk/index.jsx +58 -0
  11. package/dist/components/Daeryuntalk/index.tsx +66 -0
  12. package/dist/components/page/MyCase/[id]/_component/ContactInfo.jsx +1 -1
  13. package/dist/components/page/MyCase/[id]/_component/ContactInfo.tsx +1 -1
  14. package/dist/components/page/MyCase/[id]/_component/DetailInfo.jsx +1 -1
  15. package/dist/components/page/MyCase/[id]/_component/DetailInfo.tsx +9 -3
  16. package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.jsx +35 -14
  17. package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.tsx +19 -7
  18. package/dist/components/page/MyCase/[id]/_component/TimeLine.jsx +1 -1
  19. package/dist/components/page/MyCase/[id]/_component/TimeLine.tsx +1 -1
  20. package/dist/components/page/MyCase/[id]/_component/_badge/DocumentBadge.d.ts +4 -0
  21. package/dist/components/page/MyCase/[id]/_component/_badge/DocumentBadge.jsx +13 -0
  22. package/dist/components/page/MyCase/[id]/_component/_badge/DocumentBadge.tsx +18 -0
  23. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.jsx +1 -1
  24. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.tsx +1 -1
  25. package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +2 -1
  26. package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +63 -21
  27. package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +97 -17
  28. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.d.ts +2 -1
  29. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +58 -13
  30. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +124 -25
  31. package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.jsx +12 -7
  32. package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.tsx +12 -7
  33. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineAskSuccessModal.d.ts +5 -0
  34. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineAskSuccessModal.jsx +27 -0
  35. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineAskSuccessModal.tsx +46 -0
  36. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineStopModal.d.ts +6 -0
  37. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineStopModal.jsx +34 -0
  38. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineStopModal.tsx +65 -0
  39. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineSuccessModal.d.ts +5 -0
  40. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineSuccessModal.jsx +27 -0
  41. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineSuccessModal.tsx +47 -0
  42. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineDocumentModal.d.ts +7 -0
  43. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineDocumentModal.jsx +95 -0
  44. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineDocumentModal.tsx +141 -0
  45. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineModal.d.ts +10 -0
  46. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineModal.jsx +149 -0
  47. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineModal.tsx +212 -0
  48. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.d.ts +3 -4
  49. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.jsx +51 -34
  50. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.tsx +88 -59
  51. package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.jsx +2 -2
  52. package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.tsx +2 -2
  53. package/dist/components/page/MyCase/[id]/_component/_pdf/PdfInlineViewer.d.ts +6 -0
  54. package/dist/components/page/MyCase/[id]/_component/_pdf/PdfInlineViewer.jsx +154 -0
  55. package/dist/components/page/MyCase/[id]/_component/_pdf/PdfInlineViewer.tsx +177 -0
  56. package/dist/components/page/MyCase/_actions/action.d.ts +34 -0
  57. package/dist/components/page/MyCase/_actions/action.js +59 -0
  58. package/dist/components/page/MyCase/_actions/action.ts +79 -0
  59. package/dist/components/page/MyCase/_component/_button/SubMenuButton.jsx +2 -4
  60. package/dist/components/page/MyCase/_component/_button/SubMenuButton.tsx +2 -5
  61. package/dist/components/page/MyCase/_component/_empty/EmptyTable.d.ts +2 -1
  62. package/dist/components/page/MyCase/_component/_empty/EmptyTable.jsx +14 -6
  63. package/dist/components/page/MyCase/_component/_empty/EmptyTable.tsx +34 -6
  64. package/dist/components/page/MyCase/_component/_fileView/FilePreViewer.d.ts +14 -0
  65. package/dist/components/page/MyCase/_component/_fileView/FilePreViewer.jsx +278 -0
  66. package/dist/components/page/MyCase/_component/_fileView/FilePreViewer.tsx +411 -0
  67. package/dist/components/page/MyCase/_component/_fileView/HwpViewer.d.ts +8 -0
  68. package/dist/components/page/MyCase/_component/_fileView/HwpViewer.jsx +56 -0
  69. package/dist/components/page/MyCase/_component/_fileView/HwpViewer.tsx +111 -0
  70. package/dist/components/page/MyCase/_component/_fileView/TopOverlay.d.ts +3 -0
  71. package/dist/components/page/MyCase/_component/_fileView/TopOverlay.jsx +10 -0
  72. package/dist/components/page/MyCase/_component/_fileView/TopOverlay.tsx +10 -0
  73. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.jsx +8 -3
  74. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.tsx +3 -4
  75. package/dist/components/page/MyCase/_fetchers/addMyCaseExamine.d.ts +7 -0
  76. package/dist/components/page/MyCase/_fetchers/addMyCaseExamine.js +34 -0
  77. package/dist/components/page/MyCase/_fetchers/addMyCaseExamine.ts +36 -0
  78. package/dist/components/page/MyCase/_fetchers/getDaeryunFileList.d.ts +5 -0
  79. package/dist/components/page/MyCase/_fetchers/getDaeryunFileList.js +33 -0
  80. package/dist/components/page/MyCase/_fetchers/getDaeryunFileList.ts +25 -0
  81. package/dist/components/page/MyCase/_fetchers/getDocumentExamineHistory.d.ts +5 -0
  82. package/dist/components/page/MyCase/_fetchers/getDocumentExamineHistory.js +33 -0
  83. package/dist/components/page/MyCase/_fetchers/getDocumentExamineHistory.ts +25 -0
  84. package/dist/components/page/MyCase/_fetchers/getHwpToPdfFile.d.ts +4 -0
  85. package/dist/components/page/MyCase/_fetchers/getHwpToPdfFile.js +33 -0
  86. package/dist/components/page/MyCase/_fetchers/getHwpToPdfFile.ts +25 -0
  87. package/dist/components/page/MyCase/_type/type.d.ts +3 -1
  88. package/dist/components/page/MyCase/_type/type.ts +3 -1
  89. package/dist/styles/daeryuntalk.css +14 -0
  90. package/dist/styles/globals.css +501 -94
  91. package/dist/styles/homepage_login.css +3 -3
  92. package/dist/tsconfig.tsbuildinfo +1 -1
  93. package/package.json +6 -2
@@ -0,0 +1,212 @@
1
+ 'use client';
2
+
3
+ import Image from 'next/image';
4
+ import ModalContainer from './ModalCotainer';
5
+ import close from '../../../../../../asset/images/myCase/icon/close.webp';
6
+ import chatIcon from '../../../../../../asset/images/myCase/icon/chat.webp';
7
+ import { useState } from 'react';
8
+ import { useActionGetDaeryunFileList, useActionPostCaseExamine } from '../../../_actions/action';
9
+ import CaeeExamineSuccessModal from '../_modal/CaeeExamineSuccessModal';
10
+ import CaeeExamineAskSuccessModal from '../_modal/CaeeExamineAskSuccessModal';
11
+ import CaeeExamineStopModal from '../_modal/CaeeExamineStopModal';
12
+
13
+ type CaseExamineModalProps = {
14
+ openState: null | 'approve' | 'ask';
15
+ onClose: () => void;
16
+ item:
17
+ | {
18
+ name?: string;
19
+ // 필요하면 여기 다른 필드 추가
20
+ }
21
+ | any;
22
+ id: string;
23
+ };
24
+
25
+ const CaseExamineModal = ({ openState, onClose, item, id }: CaseExamineModalProps) => {
26
+ const [value, setValue] = useState('');
27
+ const [isStop, setIsStop] = useState(false);
28
+ const { mutateAsync, isLoading } = useActionPostCaseExamine();
29
+ const [isSuccess, setIsSuccess] = useState(false);
30
+
31
+ const { refetch: daeryunFileListRefetch } = useActionGetDaeryunFileList(id as string, undefined, false);
32
+
33
+ const menu = (() => {
34
+ switch (openState) {
35
+ case 'approve':
36
+ return {
37
+ title: '승인',
38
+ item1: '(선택)',
39
+ item1ClassName: 'text-subColor05',
40
+
41
+ buttonText: '승인'
42
+ };
43
+ case 'ask':
44
+ return {
45
+ title: '보완요청',
46
+
47
+ item1: '(필수)',
48
+ item1ClassName: 'text-mycaseMainColor',
49
+ buttonText: '보완요청'
50
+ };
51
+ default:
52
+ return {
53
+ title: '',
54
+ description: '',
55
+ buttonText: ''
56
+ };
57
+ }
58
+ })();
59
+ const handleClick = async () => {
60
+ if (openState === 'ask') {
61
+ if (value.length === 0) {
62
+ return;
63
+ }
64
+ }
65
+
66
+ const res = await mutateAsync({
67
+ caseIdx: id,
68
+ comment: value,
69
+ idx: item.idx,
70
+ isApproved: openState === 'approve'
71
+ });
72
+ if (res.result) {
73
+ setIsSuccess(true);
74
+ }
75
+ };
76
+
77
+ return (
78
+ <>
79
+ <ModalContainer
80
+ isOpen={!!openState}
81
+ onClose={() => {
82
+ if (value.length > 0) {
83
+ setIsStop(true);
84
+ return;
85
+ }
86
+
87
+ onClose();
88
+ }}
89
+ >
90
+ {/* ✅ 패딩/보더/라운드는 바깥 컨테이너, overflow는 hidden */}
91
+ <div
92
+ className={
93
+ 'absolute flex h-full max-h-full w-full flex-col overflow-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 ' +
94
+ ' sm-top:max-h-[741px] sm-top:w-[calc(100%-104px)] sm-top:max-w-[780px] sm-top:rounded-[32px] ' +
95
+ ' lg:h-full lg:max-h-[831px] lg:w-full lg:max-w-[1000px]'
96
+ }
97
+ onClick={e => e.stopPropagation()}
98
+ >
99
+ {/* ✅ 헤더: 스크롤 안 타는 영역 */}
100
+ <div className="px-[16px] pt-[32px] sm-top:px-[52px] sm-top:pt-[52px] ">
101
+ <div className="flex flex-row items-baseline justify-between gap-[19px] sm-top:items-start lg:gap-[40px] ">
102
+ <p className="title_medium_mo sm-top:title_medium_tb lg:title_medium break-all leading-[26.5px] text-black sm-top:leading-[35px] lg:leading-[40px]">
103
+ {item?.name} 문서를 {menu.title}하시겠습니까?
104
+ {/* 길이 테스트용 더미 텍스트 */}
105
+ </p>
106
+ <Image
107
+ src={close}
108
+ alt="close"
109
+ width={24}
110
+ height={24}
111
+ className="h-[16px] w-[16px] flex-shrink-0 cursor-pointer sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]"
112
+ onClick={() => {
113
+ if (value.length > 0) {
114
+ setIsStop(true);
115
+ return;
116
+ }
117
+ onClose();
118
+ }}
119
+ />
120
+ </div>
121
+ <p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 mt-[12px] text-left leading-[23px] text-grayScale2 sm-top:mt-[20px] sm-top:leading-[30px] lg:mt-[20px] lg:leading-[35px]">
122
+ 의견은 담당 변호사에게 전달됩니다.
123
+ </p>
124
+ </div>
125
+
126
+ {/* ✅ 스크롤 영역: 가운데만 overflow-y-auto */}
127
+ <div className="flex min-h-[300px] flex-1 flex-shrink-0 flex-col overflow-y-auto px-[16px] sm-top:px-[52px] lg:px-[52px]">
128
+ <div className="mt-[20px] flex flex-row items-center justify-between sm-top:mt-[52px] lg:mt-[60px]">
129
+ <div className="flex flex-row items-center">
130
+ <Image
131
+ src={chatIcon}
132
+ alt="chatIcon"
133
+ width={24}
134
+ height={24}
135
+ className="h-[15.18px] w-[16px] sm-top:h-[18.98px] sm-top:w-[20px] lg:h-[24.66px] lg:w-[26px]"
136
+ />
137
+ <p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1 ml-[4px] leading-[20px] text-black sm-top:ml-[8px] sm-top:leading-[25px] lg:ml-[10px] lg:leading-[30px]">
138
+ 나의 의견
139
+ <span
140
+ className={`body_small2_mo sm-top:body_small2_tb lg:body_small2 ml-[2px] leading-[18px] sm-top:ml-[4px] sm-top:leading-[23px] lg:leading-[25px] ${menu.item1ClassName}`}
141
+ >
142
+ {menu.item1}
143
+ </span>
144
+ </p>
145
+ </div>
146
+ <p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor">
147
+ {value.length}
148
+ <span className=" text-black"> / 200</span>
149
+ </p>
150
+ </div>
151
+
152
+ {/* ✅ 남은 공간을 전부 차지 */}
153
+ <div className="mt-[20px] min-h-[200px] flex-1 flex-shrink-0 rounded-[8px] border border-solid border-grayScale5 p-[16px] sm-top:mt-[15px] sm-top:rounded-[10px] sm-top:p-[32px] lg:mt-[18px] lg:p-[36px]">
154
+ <textarea
155
+ className="body_medium2_mo sm-top:body_medium2_tb lg:body_medium2 h-full min-h-0 w-full resize-none outline-none"
156
+ placeholder="내용을 입력해 주세요"
157
+ maxLength={200}
158
+ value={value}
159
+ onChange={e => setValue(e.target.value)}
160
+ />
161
+ </div>
162
+
163
+ {/* 필요하면 하단 여백 유지, 아니면 제거 */}
164
+ <div className="h-[16px] flex-shrink-0 sm-top:h-[32px] lg:h-[40px]" />
165
+ </div>
166
+
167
+ {/* ✅ 푸터: 스크롤 안 타는 영역 */}
168
+ <div className="px-[16px] pb-[32px] sm-top:px-[52px] sm-top:pb-[52px] lg:px-[52px] lg:pb-[52px] ">
169
+ <button
170
+ className={`body_large2_mo sm-top:body_large2_tb lg:body_large2 flex h-[48px] w-full items-center justify-center rounded-[4px] ${openState === 'approve' || value.length > 0 ? 'bg-mycaseMainColor text-white' : 'bg-grayScale6 text-grayScale3'} sm-top:h-[60px] sm-top:rounded-[8px] lg:h-[72px] lg:rounded-[16px]`}
171
+ onClick={handleClick}
172
+ >
173
+ {menu.buttonText}
174
+ </button>
175
+ </div>
176
+ </div>
177
+ </ModalContainer>
178
+ {isStop && (
179
+ <CaeeExamineStopModal
180
+ isOpen={isStop}
181
+ onAllClose={() => {
182
+ setIsStop(false);
183
+ onClose();
184
+ }}
185
+ onClose={() => setIsStop(false)}
186
+ />
187
+ )}
188
+ {isSuccess && openState === 'ask' && (
189
+ <CaeeExamineAskSuccessModal
190
+ isOpen={isSuccess}
191
+ onClose={() => {
192
+ setIsSuccess(false);
193
+ daeryunFileListRefetch();
194
+ onClose();
195
+ }}
196
+ />
197
+ )}
198
+ {isSuccess && openState === 'approve' && (
199
+ <CaeeExamineSuccessModal
200
+ isOpen={isSuccess}
201
+ onClose={() => {
202
+ setIsSuccess(false);
203
+ daeryunFileListRefetch();
204
+ onClose();
205
+ }}
206
+ />
207
+ )}
208
+ </>
209
+ );
210
+ };
211
+
212
+ export default CaseExamineModal;
@@ -1,7 +1,6 @@
1
- import { ContractImage } from '../../../_type/type';
2
- declare const ContractModal: ({ isOpen, onClose, data }: {
1
+ import type { ContractImage } from '../../../_type/type';
2
+ export default function ContractModal({ isOpen, onClose, data }: {
3
3
  isOpen: boolean;
4
4
  onClose: () => void;
5
5
  data: ContractImage[];
6
- }) => import("react").JSX.Element;
7
- export default ContractModal;
6
+ }): import("react").JSX.Element;
@@ -1,39 +1,56 @@
1
+ 'use client';
1
2
  import Image from 'next/image';
2
3
  import ModalContainer from './ModalCotainer';
3
- import { useState } from 'react';
4
4
  import close from '../../../../../../asset/images/myCase/icon/close.webp';
5
- const ContractModal = ({ isOpen, onClose, data }) => {
6
- // const [value, setValue] = useState('');
7
- // const [isCheck, setIsCheck] = useState(false);
8
- const [isOpenConfirm, setIsOpenConfirm] = useState(false);
9
- // const { mutateAsync, isLoading } = actionPostMyCaseQuestion(id, value);
10
- // console.log(isLoading);
11
- return (<>
12
- <ModalContainer isOpen={isOpen} onClose={() => {
13
- onClose();
14
- }}>
15
- <div className="absolute flex h-full w-full flex-col overflow-y-hidden rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 p-[32px] sm-top:rounded-[32px] sm-top:p-[52px] lg:h-full lg:max-h-[800px] lg:w-full lg:max-w-[1000px] " onClick={e => e.stopPropagation()}>
16
- <div className="flex flex-row items-center justify-between">
17
- <p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">내 약정서</p>
18
- <Image src={close} alt="close" width={24} height={24} onClick={() => {
19
- onClose();
20
- }} className="h-[16px] w-[16px] cursor-pointer sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]"/>
21
- </div>
22
- <div className="mt-[12px] h-[453px] w-full overflow-y-auto rounded-[8px] border border-solid border-grayScale1 sm-top:mt-[20px] sm-top:h-[605px] lg:h-[calc(100%-62px)]">
23
- {data === null || data === void 0 ? void 0 : data.map((item, index) => (<div key={index}>
24
- <Image src={item.path} alt={item.name} width={3000} height={3000} unoptimized className="h-auto w-full"/>
25
- </div>))}
26
- </div>
5
+ import PdfInlineViewer from '../_pdf/PdfInlineViewer';
6
+ // pdfjs로 전체 펼쳐 렌더
7
+ const getExt = (name) => ((name === null || name === void 0 ? void 0 : name.split('.').pop()) || '').toLowerCase();
8
+ const isPdf = (name) => getExt(name) === 'pdf';
9
+ const isHwp = (name) => {
10
+ const ext = getExt(name);
11
+ return ext === 'hwp' || ext === 'hwpx';
12
+ };
13
+ export default function ContractModal({ isOpen, onClose, data }) {
14
+ return (<ModalContainer isOpen={isOpen} onClose={onClose}>
15
+ {/* 모달 전체가 스크롤(콘텐츠 섹션엔 고정 height/overflow 넣지 않음) */}
16
+ <div className="absolute flex h-full w-full flex-col overflow-y-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 pb-[32px]
17
+ sm-top:rounded-[32px] sm-top:pb-[52px]
18
+ lg:h-full lg:max-h-[800px] lg:w-full lg:max-w-[1000px]" onClick={e => e.stopPropagation()}>
19
+ <div className="sticky top-0 z-10 flex flex-row items-center justify-between bg-grayScale8/95 px-[32px] pb-[8px] pt-[40px] backdrop-blur sm-top:px-[52px] sm-top:pt-[40px]">
20
+ <p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">내 약정서</p>
21
+ <Image src={close} alt="close" width={24} height={24} onClick={onClose} className="h-[16px] w-[16px] cursor-pointer sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]"/>
22
+ </div>
27
23
 
28
- {/* {isLoading ? (
29
- <div className="absolute top-[0] flex h-full w-full items-center justify-center">
30
- <Loading />
31
- </div>
32
- ) : (
33
- <></>
34
- )} */}
24
+ <div className="mx-auto mt-[12px] w-full max-w-[calc(100%-64px)] rounded-[8px] border border-solid border-grayScale1 p-0 sm-top:mt-[20px] sm-top:max-w-[calc(100%-104px)]">
25
+ <div className="space-y-6 p-3">
26
+ {data === null || data === void 0 ? void 0 : data.map((item, index) => {
27
+ var _a;
28
+ const key = `${item.path}-${index}`;
29
+ if (isPdf(item.name)) {
30
+ // ✅ PDF: 페이지가 캔버스로 “쭉 펼쳐짐”
31
+ return <PdfInlineViewer key={key} url={item.path} name={item.name}/>;
32
+ }
33
+ if (isHwp(item.name)) {
34
+ return (<div key={key} className="w-full overflow-hidden rounded-lg border border-dashed border-gray-300">
35
+ <div className="flex items-center justify-between px-3 py-2 text-sm">
36
+ <span className="truncate">{item.name}</span>
37
+ <a href={item.path} download className="underline">
38
+ 다운로드
39
+ </a>
40
+ </div>
41
+ <div className="px-3 pb-4 text-sm text-gray-600">
42
+ 이 형식(HWP/HWXP)은 웹 미리보기를 지원하지 않습니다. PDF/이미지 변환 또는
43
+ 한컴 웹 뷰어가 필요합니다.
44
+ </div>
45
+ </div>);
46
+ }
47
+ // 이미지 그대로
48
+ return (<div key={key} className="w-full overflow-hidden rounded-lg">
49
+ <Image src={item.path} alt={(_a = item.name) !== null && _a !== void 0 ? _a : 'image'} width={3000} height={3000} unoptimized className="block h-auto w-full"/>
50
+ </div>);
51
+ })}
52
+ </div>
35
53
  </div>
36
- </ModalContainer>
37
- </>);
38
- };
39
- export default ContractModal;
54
+ </div>
55
+ </ModalContainer>);
56
+ }
@@ -1,69 +1,98 @@
1
- import Image from 'next/image';
2
- import ModalContainer from './ModalCotainer';
1
+ 'use client';
3
2
 
4
- import { useState } from 'react';
3
+ import Image from 'next/image';
5
4
 
5
+ import ModalContainer from './ModalCotainer';
6
6
  import close from '../../../../../../asset/images/myCase/icon/close.webp';
7
- import { ContractImage } from '../../../_type/type';
7
+ import type { ContractImage } from '../../../_type/type';
8
+ import PdfInlineViewer from '../_pdf/PdfInlineViewer';
8
9
 
9
- const ContractModal = ({ isOpen, onClose, data }: { isOpen: boolean; onClose: () => void; data: ContractImage[] }) => {
10
- // const [value, setValue] = useState('');
11
- // const [isCheck, setIsCheck] = useState(false);
12
- const [isOpenConfirm, setIsOpenConfirm] = useState(false);
10
+ // pdfjs로 전체 펼쳐 렌더
13
11
 
14
- // const { mutateAsync, isLoading } = actionPostMyCaseQuestion(id, value);
15
- // console.log(isLoading);
12
+ const getExt = (name?: string) => (name?.split('.').pop() || '').toLowerCase();
13
+ const isPdf = (name?: string) => getExt(name) === 'pdf';
14
+ const isHwp = (name?: string) => {
15
+ const ext = getExt(name);
16
+ return ext === 'hwp' || ext === 'hwpx';
17
+ };
18
+
19
+ export default function ContractModal({
20
+ isOpen,
21
+ onClose,
22
+ data
23
+ }: {
24
+ isOpen: boolean;
25
+ onClose: () => void;
26
+ data: ContractImage[];
27
+ }) {
16
28
  return (
17
- <>
18
- <ModalContainer
19
- isOpen={isOpen}
20
- onClose={() => {
21
- onClose();
22
- }}
29
+ <ModalContainer isOpen={isOpen} onClose={onClose}>
30
+ {/* 모달 전체가 스크롤(콘텐츠 섹션엔 고정 height/overflow 넣지 않음) */}
31
+ <div
32
+ className="absolute flex h-full w-full flex-col overflow-y-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 pb-[32px]
33
+ sm-top:rounded-[32px] sm-top:pb-[52px]
34
+ lg:h-full lg:max-h-[800px] lg:w-full lg:max-w-[1000px]"
35
+ onClick={e => e.stopPropagation()}
23
36
  >
24
- <div
25
- className="absolute flex h-full w-full flex-col overflow-y-hidden rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 p-[32px] sm-top:rounded-[32px] sm-top:p-[52px] lg:h-full lg:max-h-[800px] lg:w-full lg:max-w-[1000px] "
26
- onClick={e => e.stopPropagation()}
27
- >
28
- <div className="flex flex-row items-center justify-between">
29
- <p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">내 약정서</p>
30
- <Image
31
- src={close}
32
- alt="close"
33
- width={24}
34
- height={24}
35
- onClick={() => {
36
- onClose();
37
- }}
38
- className="h-[16px] w-[16px] cursor-pointer sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]"
39
- />
40
- </div>
41
- <div className="mt-[12px] h-[453px] w-full overflow-y-auto rounded-[8px] border border-solid border-grayScale1 sm-top:mt-[20px] sm-top:h-[605px] lg:h-[calc(100%-62px)]">
42
- {data?.map((item, index) => (
43
- <div key={index}>
44
- <Image
45
- src={item.path}
46
- alt={item.name}
47
- width={3000}
48
- height={3000}
49
- unoptimized
50
- className="h-auto w-full"
51
- />
52
- </div>
53
- ))}
54
- </div>
37
+ <div className="sticky top-0 z-10 flex flex-row items-center justify-between bg-grayScale8/95 px-[32px] pb-[8px] pt-[40px] backdrop-blur sm-top:px-[52px] sm-top:pt-[40px]">
38
+ <p className="title_medium_mo sm-top:title_medium_tb lg:title_medium text-black">내 약정서</p>
39
+ <Image
40
+ src={close}
41
+ alt="close"
42
+ width={24}
43
+ height={24}
44
+ onClick={onClose}
45
+ className="h-[16px] w-[16px] cursor-pointer sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]"
46
+ />
47
+ </div>
48
+
49
+ <div className="mx-auto mt-[12px] w-full max-w-[calc(100%-64px)] rounded-[8px] border border-solid border-grayScale1 p-0 sm-top:mt-[20px] sm-top:max-w-[calc(100%-104px)]">
50
+ <div className="space-y-6 p-3">
51
+ {data?.map((item, index) => {
52
+ const key = `${item.path}-${index}`;
53
+
54
+ if (isPdf(item.name)) {
55
+ // ✅ PDF: 페이지가 캔버스로 “쭉 펼쳐짐”
56
+ return <PdfInlineViewer key={key} url={item.path} name={item.name} />;
57
+ }
58
+
59
+ if (isHwp(item.name)) {
60
+ return (
61
+ <div
62
+ key={key}
63
+ className="w-full overflow-hidden rounded-lg border border-dashed border-gray-300"
64
+ >
65
+ <div className="flex items-center justify-between px-3 py-2 text-sm">
66
+ <span className="truncate">{item.name}</span>
67
+ <a href={item.path} download className="underline">
68
+ 다운로드
69
+ </a>
70
+ </div>
71
+ <div className="px-3 pb-4 text-sm text-gray-600">
72
+ 이 형식(HWP/HWXP)은 웹 미리보기를 지원하지 않습니다. PDF/이미지 변환 또는
73
+ 한컴 웹 뷰어가 필요합니다.
74
+ </div>
75
+ </div>
76
+ );
77
+ }
55
78
 
56
- {/* {isLoading ? (
57
- <div className="absolute top-[0] flex h-full w-full items-center justify-center">
58
- <Loading />
59
- </div>
60
- ) : (
61
- <></>
62
- )} */}
79
+ // 이미지 그대로
80
+ return (
81
+ <div key={key} className="w-full overflow-hidden rounded-lg">
82
+ <Image
83
+ src={item.path}
84
+ alt={item.name ?? 'image'}
85
+ width={3000}
86
+ height={3000}
87
+ unoptimized
88
+ className="block h-auto w-full"
89
+ />
90
+ </div>
91
+ );
92
+ })}
93
+ </div>
63
94
  </div>
64
- </ModalContainer>
65
- </>
95
+ </div>
96
+ </ModalContainer>
66
97
  );
67
- };
68
-
69
- export default ContractModal;
98
+ }
@@ -1,6 +1,6 @@
1
1
  import Image from 'next/image';
2
2
  import ModalContainer from './ModalCotainer';
3
- import modalCheck from '../../../../../../asset/images/myCase/icon/modal_icon.webp';
3
+ import modalCheck from '../../../../../../asset/images/myCase/icon/check_ok.webp';
4
4
  const CaseInquiryConfirmModal = ({ isOpen, onClose }) => {
5
5
  // console.log(isLoading);
6
6
  return (<ModalContainer isOpen={isOpen} onClose={() => {
@@ -9,7 +9,7 @@ const CaseInquiryConfirmModal = ({ isOpen, onClose }) => {
9
9
  <div className="absolute flex w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[12px] border border-solid border-grayScale4 bg-grayScale8 p-[30px] sm-top:w-[calc(100%-252px)] sm-top:max-w-[648px] sm-top:rounded-[24px] sm-top:px-[54px] sm-top:py-[44px] lg:w-full lg:max-w-[804px] lg:p-[52px] " onClick={e => e.stopPropagation()}>
10
10
  <Image src={modalCheck} alt="check" width={40} height={48.9} className="h-[48.9px] w-[40px] sm-top:h-[68.44px] sm-top:w-[56px] lg:h-[88px] lg:w-[72px]"/>
11
11
  <p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 mt-[20.11px] sm-top:mt-[48px] lg:mt-[60px]">
12
- 파일 제출이 완료되었습니다.
12
+ 문서 제출이 완료되었습니다.
13
13
  </p>
14
14
 
15
15
  <button className={`mt-[20px] h-[48px] w-full rounded-[4px] bg-grayScale1 sm-top:mt-[53px] sm-top:h-[60px] sm-top:rounded-[8px] lg:mt-[73px] lg:h-[72px] lg:rounded-[16px] `} onClick={() => {
@@ -1,6 +1,6 @@
1
1
  import Image from 'next/image';
2
2
  import ModalContainer from './ModalCotainer';
3
- import modalCheck from '../../../../../../asset/images/myCase/icon/modal_icon.webp';
3
+ import modalCheck from '../../../../../../asset/images/myCase/icon/check_ok.webp';
4
4
 
5
5
  const CaseInquiryConfirmModal = ({ isOpen, onClose }: { isOpen: boolean; onClose: () => void }) => {
6
6
  // console.log(isLoading);
@@ -23,7 +23,7 @@ const CaseInquiryConfirmModal = ({ isOpen, onClose }: { isOpen: boolean; onClose
23
23
  className="h-[48.9px] w-[40px] sm-top:h-[68.44px] sm-top:w-[56px] lg:h-[88px] lg:w-[72px]"
24
24
  />
25
25
  <p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 mt-[20.11px] sm-top:mt-[48px] lg:mt-[60px]">
26
- 파일 제출이 완료되었습니다.
26
+ 문서 제출이 완료되었습니다.
27
27
  </p>
28
28
 
29
29
  <button
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ url: string;
3
+ name?: string;
4
+ };
5
+ export default function PdfSpread({ url, name }: Props): import("react").JSX.Element;
6
+ export {};