@daeryun/dr_components 1.1.61 → 1.1.62

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 (80) hide show
  1. package/dist/components/page/MyCase/[id]/_component/ContactInfo.jsx +1 -1
  2. package/dist/components/page/MyCase/[id]/_component/ContactInfo.tsx +1 -1
  3. package/dist/components/page/MyCase/[id]/_component/DetailInfo.jsx +1 -1
  4. package/dist/components/page/MyCase/[id]/_component/DetailInfo.tsx +3 -9
  5. package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.jsx +14 -35
  6. package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.tsx +7 -19
  7. package/dist/components/page/MyCase/[id]/_component/TimeLine.jsx +1 -1
  8. package/dist/components/page/MyCase/[id]/_component/TimeLine.tsx +1 -1
  9. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.jsx +1 -1
  10. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.tsx +1 -1
  11. package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +1 -2
  12. package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +21 -63
  13. package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +17 -97
  14. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.d.ts +1 -2
  15. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +13 -58
  16. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +25 -124
  17. package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.jsx +7 -12
  18. package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.tsx +7 -12
  19. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.d.ts +4 -3
  20. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.jsx +34 -51
  21. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.tsx +59 -88
  22. package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.jsx +2 -2
  23. package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.tsx +2 -2
  24. package/dist/components/page/MyCase/_actions/action.d.ts +0 -34
  25. package/dist/components/page/MyCase/_actions/action.js +0 -59
  26. package/dist/components/page/MyCase/_actions/action.ts +0 -79
  27. package/dist/components/page/MyCase/_component/_button/SubMenuButton.jsx +4 -2
  28. package/dist/components/page/MyCase/_component/_button/SubMenuButton.tsx +5 -2
  29. package/dist/components/page/MyCase/_component/_empty/EmptyTable.d.ts +1 -2
  30. package/dist/components/page/MyCase/_component/_empty/EmptyTable.jsx +6 -14
  31. package/dist/components/page/MyCase/_component/_empty/EmptyTable.tsx +6 -34
  32. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.jsx +3 -8
  33. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.tsx +4 -3
  34. package/dist/components/page/MyCase/_type/type.d.ts +1 -3
  35. package/dist/components/page/MyCase/_type/type.ts +1 -3
  36. package/dist/styles/globals.css +92 -515
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +1 -1
  39. package/dist/components/page/MyCase/[id]/_component/_badge/DocumentBadge.d.ts +0 -4
  40. package/dist/components/page/MyCase/[id]/_component/_badge/DocumentBadge.jsx +0 -13
  41. package/dist/components/page/MyCase/[id]/_component/_badge/DocumentBadge.tsx +0 -18
  42. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineAskSuccessModal.d.ts +0 -5
  43. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineAskSuccessModal.jsx +0 -27
  44. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineAskSuccessModal.tsx +0 -46
  45. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineStopModal.d.ts +0 -6
  46. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineStopModal.jsx +0 -34
  47. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineStopModal.tsx +0 -65
  48. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineSuccessModal.d.ts +0 -5
  49. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineSuccessModal.jsx +0 -27
  50. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineSuccessModal.tsx +0 -47
  51. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineDocumentModal.d.ts +0 -7
  52. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineDocumentModal.jsx +0 -93
  53. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineDocumentModal.tsx +0 -139
  54. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineModal.d.ts +0 -10
  55. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineModal.jsx +0 -149
  56. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineModal.tsx +0 -212
  57. package/dist/components/page/MyCase/[id]/_component/_pdf/PdfInlineViewer.d.ts +0 -6
  58. package/dist/components/page/MyCase/[id]/_component/_pdf/PdfInlineViewer.jsx +0 -154
  59. package/dist/components/page/MyCase/[id]/_component/_pdf/PdfInlineViewer.tsx +0 -177
  60. package/dist/components/page/MyCase/_component/_fileView/FilePreViewer.d.ts +0 -14
  61. package/dist/components/page/MyCase/_component/_fileView/FilePreViewer.jsx +0 -278
  62. package/dist/components/page/MyCase/_component/_fileView/FilePreViewer.tsx +0 -411
  63. package/dist/components/page/MyCase/_component/_fileView/HwpViewer.d.ts +0 -8
  64. package/dist/components/page/MyCase/_component/_fileView/HwpViewer.jsx +0 -56
  65. package/dist/components/page/MyCase/_component/_fileView/HwpViewer.tsx +0 -111
  66. package/dist/components/page/MyCase/_component/_fileView/TopOverlay.d.ts +0 -3
  67. package/dist/components/page/MyCase/_component/_fileView/TopOverlay.jsx +0 -10
  68. package/dist/components/page/MyCase/_component/_fileView/TopOverlay.tsx +0 -10
  69. package/dist/components/page/MyCase/_fetchers/addMyCaseExamine.d.ts +0 -7
  70. package/dist/components/page/MyCase/_fetchers/addMyCaseExamine.js +0 -34
  71. package/dist/components/page/MyCase/_fetchers/addMyCaseExamine.ts +0 -36
  72. package/dist/components/page/MyCase/_fetchers/getDaeryunFileList.d.ts +0 -5
  73. package/dist/components/page/MyCase/_fetchers/getDaeryunFileList.js +0 -33
  74. package/dist/components/page/MyCase/_fetchers/getDaeryunFileList.ts +0 -25
  75. package/dist/components/page/MyCase/_fetchers/getDocumentExamineHistory.d.ts +0 -5
  76. package/dist/components/page/MyCase/_fetchers/getDocumentExamineHistory.js +0 -33
  77. package/dist/components/page/MyCase/_fetchers/getDocumentExamineHistory.ts +0 -25
  78. package/dist/components/page/MyCase/_fetchers/getHwpToPdfFile.d.ts +0 -4
  79. package/dist/components/page/MyCase/_fetchers/getHwpToPdfFile.js +0 -33
  80. package/dist/components/page/MyCase/_fetchers/getHwpToPdfFile.ts +0 -25
@@ -1,149 +0,0 @@
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 Image from 'next/image';
12
- import ModalContainer from './ModalCotainer';
13
- import close from '../../../../../../asset/images/myCase/icon/close.webp';
14
- import chatIcon from '../../../../../../asset/images/myCase/icon/chat.webp';
15
- import { useState } from 'react';
16
- import { useActionGetDaeryunFileList, useActionPostCaseExamine } from '../../../_actions/action';
17
- import CaeeExamineSuccessModal from '../_modal/CaeeExamineSuccessModal';
18
- import CaeeExamineAskSuccessModal from '../_modal/CaeeExamineAskSuccessModal';
19
- import CaeeExamineStopModal from '../_modal/CaeeExamineStopModal';
20
- const CaseExamineModal = ({ openState, onClose, item, id }) => {
21
- const [value, setValue] = useState('');
22
- const [isStop, setIsStop] = useState(false);
23
- const { mutateAsync, isLoading } = useActionPostCaseExamine();
24
- const [isSuccess, setIsSuccess] = useState(false);
25
- const { refetch: daeryunFileListRefetch } = useActionGetDaeryunFileList(id, undefined, false);
26
- const menu = (() => {
27
- switch (openState) {
28
- case 'approve':
29
- return {
30
- title: '승인',
31
- item1: '(선택)',
32
- item1ClassName: 'text-subColor05',
33
- buttonText: '승인'
34
- };
35
- case 'ask':
36
- return {
37
- title: '보완요청',
38
- item1: '(필수)',
39
- item1ClassName: 'text-mycaseMainColor',
40
- buttonText: '보완요청'
41
- };
42
- default:
43
- return {
44
- title: '',
45
- description: '',
46
- buttonText: ''
47
- };
48
- }
49
- })();
50
- const handleClick = () => __awaiter(void 0, void 0, void 0, function* () {
51
- if (openState === 'ask') {
52
- if (value.length === 0) {
53
- return;
54
- }
55
- }
56
- const res = yield mutateAsync({
57
- caseIdx: id,
58
- comment: value,
59
- idx: item.idx,
60
- isApproved: openState === 'approve'
61
- });
62
- if (res.result) {
63
- setIsSuccess(true);
64
- }
65
- });
66
- return (<>
67
- <ModalContainer isOpen={!!openState} onClose={() => {
68
- if (value.length > 0) {
69
- setIsStop(true);
70
- return;
71
- }
72
- onClose();
73
- }}>
74
- {/* ✅ 패딩/보더/라운드는 바깥 컨테이너, overflow는 hidden */}
75
- <div className={'absolute flex h-full max-h-full w-full flex-col overflow-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 ' +
76
- ' sm-top:max-h-[741px] sm-top:w-[calc(100%-104px)] sm-top:max-w-[780px] sm-top:rounded-[32px] ' +
77
- ' lg:h-full lg:max-h-[831px] lg:w-full lg:max-w-[1000px]'} onClick={e => e.stopPropagation()}>
78
- {/* ✅ 헤더: 스크롤 안 타는 영역 */}
79
- <div className="px-[16px] pt-[32px] sm-top:px-[52px] sm-top:pt-[52px] ">
80
- <div className="flex flex-row items-baseline justify-between gap-[19px] sm-top:items-start lg:gap-[40px] ">
81
- <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]">
82
- {item === null || item === void 0 ? void 0 : item.name} 문서를 {menu.title}하시겠습니까?
83
- {/* 길이 테스트용 더미 텍스트 */}
84
- </p>
85
- <Image src={close} alt="close" width={24} height={24} className="h-[16px] w-[16px] flex-shrink-0 cursor-pointer sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]" onClick={() => {
86
- if (value.length > 0) {
87
- setIsStop(true);
88
- return;
89
- }
90
- onClose();
91
- }}/>
92
- </div>
93
- <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]">
94
- 의견은 담당 변호사에게 전달됩니다.
95
- </p>
96
- </div>
97
-
98
- {/* ✅ 스크롤 영역: 가운데만 overflow-y-auto */}
99
- <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]">
100
- <div className="mt-[20px] flex flex-row items-center justify-between sm-top:mt-[52px] lg:mt-[60px]">
101
- <div className="flex flex-row items-center">
102
- <Image src={chatIcon} alt="chatIcon" width={24} height={24} className="h-[15.18px] w-[16px] sm-top:h-[18.98px] sm-top:w-[20px] lg:h-[24.66px] lg:w-[26px]"/>
103
- <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]">
104
- 나의 의견
105
- <span 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}`}>
106
- {menu.item1}
107
- </span>
108
- </p>
109
- </div>
110
- <p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor">
111
- {value.length}
112
- <span className=" text-black"> / 200</span>
113
- </p>
114
- </div>
115
-
116
- {/* ✅ 남은 공간을 전부 차지 */}
117
- <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]">
118
- <textarea className="body_medium2_mo sm-top:body_medium2_tb lg:body_medium2 h-full min-h-0 w-full resize-none outline-none" placeholder="내용을 입력해 주세요" maxLength={200} value={value} onChange={e => setValue(e.target.value)}/>
119
- </div>
120
-
121
- {/* 필요하면 하단 여백 유지, 아니면 제거 */}
122
- <div className="h-[16px] flex-shrink-0 sm-top:h-[32px] lg:h-[40px]"/>
123
- </div>
124
-
125
- {/* ✅ 푸터: 스크롤 안 타는 영역 */}
126
- <div className="px-[16px] pb-[32px] sm-top:px-[52px] sm-top:pb-[52px] lg:px-[52px] lg:pb-[52px] ">
127
- <button 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]`} onClick={handleClick}>
128
- {menu.buttonText}
129
- </button>
130
- </div>
131
- </div>
132
- </ModalContainer>
133
- {isStop && (<CaeeExamineStopModal isOpen={isStop} onAllClose={() => {
134
- setIsStop(false);
135
- onClose();
136
- }} onClose={() => setIsStop(false)}/>)}
137
- {isSuccess && openState === 'ask' && (<CaeeExamineAskSuccessModal isOpen={isSuccess} onClose={() => {
138
- setIsSuccess(false);
139
- daeryunFileListRefetch();
140
- onClose();
141
- }}/>)}
142
- {isSuccess && openState === 'approve' && (<CaeeExamineSuccessModal isOpen={isSuccess} onClose={() => {
143
- setIsSuccess(false);
144
- daeryunFileListRefetch();
145
- onClose();
146
- }}/>)}
147
- </>);
148
- };
149
- export default CaseExamineModal;
@@ -1,212 +0,0 @@
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,6 +0,0 @@
1
- type Props = {
2
- url: string;
3
- name?: string;
4
- };
5
- export default function PdfSpread({ url, name }: Props): import("react").JSX.Element;
6
- export {};
@@ -1,154 +0,0 @@
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 { useEffect, useRef, useState } from 'react';
12
- import * as pdfjsLib from 'pdfjs-dist';
13
- // pdf.js worker (pdfjs-dist 3.x)
14
- pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js';
15
- export default function PdfSpread({ url, name }) {
16
- const hostRef = useRef(null);
17
- // 문서 객체
18
- const pdfRef = useRef(null);
19
- const [numPages, setNumPages] = useState(0);
20
- // 컨테이너 폭 (ResizeObserver 사용)
21
- const [width, setWidth] = useState(0);
22
- const roRef = useRef(null);
23
- // 페이지별 진행 중인 렌더 태스크 & 캔버스
24
- const tasksRef = useRef(new Map());
25
- const canvasesRef = useRef(new Map());
26
- // 렌더 세션 토큰 (stale run 무시용)
27
- const sessionRef = useRef(null);
28
- // 컨테이너 폭 관찰
29
- useEffect(() => {
30
- const el = hostRef.current;
31
- if (!el)
32
- return;
33
- const ro = new ResizeObserver(entries => {
34
- for (const entry of entries) {
35
- const cw = Math.floor(entry.contentRect.width);
36
- if (cw && cw !== width)
37
- setWidth(cw);
38
- }
39
- });
40
- ro.observe(el);
41
- roRef.current = ro;
42
- // 초기 폭
43
- setWidth(el.clientWidth);
44
- return () => {
45
- ro.disconnect();
46
- roRef.current = null;
47
- };
48
- }, []);
49
- // 문서 로드
50
- useEffect(() => {
51
- let cancelled = false;
52
- // 이전 상태 정리
53
- cancelAll();
54
- clearHost();
55
- setNumPages(0);
56
- pdfRef.current = null;
57
- (() => __awaiter(this, void 0, void 0, function* () {
58
- try {
59
- const pdf = yield pdfjsLib.getDocument({
60
- url,
61
- // 서버가 Range를 지원 안 하거나 CORS가 애매할 때 대비 옵션(필요 시 조정)
62
- disableStream: false,
63
- disableAutoFetch: false
64
- }).promise;
65
- if (cancelled)
66
- return;
67
- pdfRef.current = pdf;
68
- setNumPages(pdf.numPages);
69
- }
70
- catch (e) {
71
- // eslint-disable-next-line no-console
72
- console.error('[PdfSpread] load error:', e);
73
- }
74
- }))();
75
- return () => {
76
- cancelled = true;
77
- cancelAll();
78
- clearHost();
79
- };
80
- }, [url]);
81
- // 렌더링
82
- useEffect(() => {
83
- const pdf = pdfRef.current;
84
- if (!pdf || !numPages || !width)
85
- return;
86
- // 새 세션 시작
87
- const token = Symbol('render-session');
88
- sessionRef.current = token;
89
- // 이전 작업/캔버스 정리
90
- cancelAll();
91
- clearHost();
92
- const host = hostRef.current;
93
- let aborted = false;
94
- (() => __awaiter(this, void 0, void 0, function* () {
95
- for (let i = 1; i <= numPages; i++) {
96
- if (aborted)
97
- break;
98
- if (sessionRef.current !== token)
99
- break; // stale run 무시
100
- try {
101
- const page = yield pdf.getPage(i);
102
- const unscaled = page.getViewport({ scale: 1 });
103
- const scale = width / unscaled.width;
104
- const viewport = page.getViewport({ scale });
105
- // 새 캔버스 생성(재사용 X가 가장 안전)
106
- const canvas = document.createElement('canvas');
107
- canvas.className = 'mb-3 block overflow-hidden rounded bg-white';
108
- canvas.width = Math.floor(viewport.width);
109
- canvas.height = Math.floor(viewport.height);
110
- canvas.style.width = `${viewport.width}px`;
111
- canvas.style.height = `${viewport.height}px`;
112
- host.appendChild(canvas);
113
- canvasesRef.current.set(i, canvas);
114
- const ctx = canvas.getContext('2d');
115
- const task = page.render({ canvasContext: ctx, viewport });
116
- tasksRef.current.set(i, task);
117
- yield task.promise; // 순차 렌더
118
- tasksRef.current.delete(i);
119
- // page.cleanup(); // 필요 시 활성화
120
- }
121
- catch (e) {
122
- // cancel() 시 RenderingCancelledException 발생 → 무시
123
- if ((e === null || e === void 0 ? void 0 : e.name) !== 'RenderingCancelledException') {
124
- // eslint-disable-next-line no-console
125
- console.warn('[PdfSpread] render error page', i, e);
126
- }
127
- }
128
- }
129
- }))();
130
- return () => {
131
- aborted = true;
132
- // 다음 세션에서 clearHost()가 정리합니다.
133
- };
134
- }, [numPages, width]);
135
- function cancelAll() {
136
- tasksRef.current.forEach(task => {
137
- try {
138
- task.cancel();
139
- }
140
- catch (_a) { }
141
- });
142
- tasksRef.current.clear();
143
- }
144
- function clearHost() {
145
- const host = hostRef.current;
146
- if (host)
147
- host.innerHTML = '';
148
- canvasesRef.current.clear();
149
- }
150
- return (<div className="w-full overflow-hidden rounded-lg border border-gray-200">
151
- {/* 이 블록의 가로폭에 맞춰 모든 페이지를 “쭉” 렌더 */}
152
- <div ref={hostRef} className="w-full p-3"/>
153
- </div>);
154
- }