@tipp/ui 2.9.0 → 2.10.1

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 (198) hide show
  1. package/dist/app/index.js +17 -17
  2. package/dist/app/platform/edit-coaching-time.js +17 -17
  3. package/dist/app/platform/edit-service-type.js +17 -17
  4. package/dist/app/platform/goal-manage-card-edit.js +17 -17
  5. package/dist/app/platform/on-offline-radio-card.js +17 -17
  6. package/dist/app/platform/reservation-card.js +17 -17
  7. package/dist/app/platform/session-card.js +17 -17
  8. package/dist/app/roleplay/chart/session-chart.cjs +351 -0
  9. package/dist/app/roleplay/chart/session-chart.cjs.map +1 -0
  10. package/dist/app/roleplay/chart/session-chart.d.cts +16 -0
  11. package/dist/app/roleplay/chart/session-chart.d.ts +16 -0
  12. package/dist/app/roleplay/chart/session-chart.js +14 -0
  13. package/dist/app/roleplay/chart/session-chart.js.map +1 -0
  14. package/dist/app/roleplay/index.cjs +5715 -0
  15. package/dist/app/roleplay/index.cjs.map +1 -0
  16. package/dist/app/roleplay/index.d.cts +4 -0
  17. package/dist/app/roleplay/index.d.ts +4 -0
  18. package/dist/app/roleplay/index.js +182 -0
  19. package/dist/app/roleplay/index.js.map +1 -0
  20. package/dist/app/roleplay/parts/analysis-section.cjs +2178 -0
  21. package/dist/app/roleplay/parts/analysis-section.cjs.map +1 -0
  22. package/dist/app/roleplay/parts/analysis-section.d.cts +17 -0
  23. package/dist/app/roleplay/parts/analysis-section.d.ts +17 -0
  24. package/dist/app/roleplay/parts/analysis-section.js +97 -0
  25. package/dist/app/roleplay/parts/analysis-section.js.map +1 -0
  26. package/dist/app/roleplay/parts/coaching-panel.cjs +2191 -0
  27. package/dist/app/roleplay/parts/coaching-panel.cjs.map +1 -0
  28. package/dist/app/roleplay/parts/coaching-panel.d.cts +8 -0
  29. package/dist/app/roleplay/parts/coaching-panel.d.ts +8 -0
  30. package/dist/app/roleplay/parts/coaching-panel.js +95 -0
  31. package/dist/app/roleplay/parts/coaching-panel.js.map +1 -0
  32. package/dist/app/roleplay/parts/content.cjs +4687 -0
  33. package/dist/app/roleplay/parts/content.cjs.map +1 -0
  34. package/dist/app/roleplay/parts/content.d.cts +15 -0
  35. package/dist/app/roleplay/parts/content.d.ts +15 -0
  36. package/dist/app/roleplay/parts/content.js +174 -0
  37. package/dist/app/roleplay/parts/content.js.map +1 -0
  38. package/dist/app/roleplay/parts/header.cjs +2300 -0
  39. package/dist/app/roleplay/parts/header.cjs.map +1 -0
  40. package/dist/app/roleplay/parts/header.d.cts +13 -0
  41. package/dist/app/roleplay/parts/header.d.ts +13 -0
  42. package/dist/app/roleplay/parts/header.js +96 -0
  43. package/dist/app/roleplay/parts/header.js.map +1 -0
  44. package/dist/app/roleplay/parts/score-summary.cjs +2276 -0
  45. package/dist/app/roleplay/parts/score-summary.cjs.map +1 -0
  46. package/dist/app/roleplay/parts/score-summary.d.cts +12 -0
  47. package/dist/app/roleplay/parts/score-summary.d.ts +12 -0
  48. package/dist/app/roleplay/parts/score-summary.js +96 -0
  49. package/dist/app/roleplay/parts/score-summary.js.map +1 -0
  50. package/dist/app/roleplay/parts/score-trend-section.cjs +3687 -0
  51. package/dist/app/roleplay/parts/score-trend-section.cjs.map +1 -0
  52. package/dist/app/roleplay/parts/score-trend-section.d.cts +14 -0
  53. package/dist/app/roleplay/parts/score-trend-section.d.ts +14 -0
  54. package/dist/app/roleplay/parts/score-trend-section.js +167 -0
  55. package/dist/app/roleplay/parts/score-trend-section.js.map +1 -0
  56. package/dist/app/roleplay/parts/script-transcript.cjs +2288 -0
  57. package/dist/app/roleplay/parts/script-transcript.cjs.map +1 -0
  58. package/dist/app/roleplay/parts/script-transcript.d.cts +15 -0
  59. package/dist/app/roleplay/parts/script-transcript.d.ts +15 -0
  60. package/dist/app/roleplay/parts/script-transcript.js +96 -0
  61. package/dist/app/roleplay/parts/script-transcript.js.map +1 -0
  62. package/dist/app/roleplay/parts/section-nav.cjs +2433 -0
  63. package/dist/app/roleplay/parts/section-nav.cjs.map +1 -0
  64. package/dist/app/roleplay/parts/section-nav.d.cts +15 -0
  65. package/dist/app/roleplay/parts/section-nav.d.ts +15 -0
  66. package/dist/app/roleplay/parts/section-nav.js +96 -0
  67. package/dist/app/roleplay/parts/section-nav.js.map +1 -0
  68. package/dist/app/roleplay/parts/session-replay-dialog.cjs +2598 -0
  69. package/dist/app/roleplay/parts/session-replay-dialog.cjs.map +1 -0
  70. package/dist/app/roleplay/parts/session-replay-dialog.d.cts +14 -0
  71. package/dist/app/roleplay/parts/session-replay-dialog.d.ts +14 -0
  72. package/dist/app/roleplay/parts/session-replay-dialog.js +97 -0
  73. package/dist/app/roleplay/parts/session-replay-dialog.js.map +1 -0
  74. package/dist/app/roleplay/parts/step-detail.cjs +2311 -0
  75. package/dist/app/roleplay/parts/step-detail.cjs.map +1 -0
  76. package/dist/app/roleplay/parts/step-detail.d.cts +9 -0
  77. package/dist/app/roleplay/parts/step-detail.d.ts +9 -0
  78. package/dist/app/roleplay/parts/step-detail.js +96 -0
  79. package/dist/app/roleplay/parts/step-detail.js.map +1 -0
  80. package/dist/app/roleplay/parts/step-radar.cjs +463 -0
  81. package/dist/app/roleplay/parts/step-radar.cjs.map +1 -0
  82. package/dist/app/roleplay/parts/step-radar.d.cts +8 -0
  83. package/dist/app/roleplay/parts/step-radar.d.ts +8 -0
  84. package/dist/app/roleplay/parts/step-radar.js +14 -0
  85. package/dist/app/roleplay/parts/step-radar.js.map +1 -0
  86. package/dist/app/roleplay/parts/step-summary.cjs +2651 -0
  87. package/dist/app/roleplay/parts/step-summary.cjs.map +1 -0
  88. package/dist/app/roleplay/parts/step-summary.d.cts +8 -0
  89. package/dist/app/roleplay/parts/step-summary.d.ts +8 -0
  90. package/dist/app/roleplay/parts/step-summary.js +101 -0
  91. package/dist/app/roleplay/parts/step-summary.js.map +1 -0
  92. package/dist/app/roleplay/rp-session-detail.cjs +5712 -0
  93. package/dist/app/roleplay/rp-session-detail.cjs.map +1 -0
  94. package/dist/app/roleplay/rp-session-detail.d.cts +17 -0
  95. package/dist/app/roleplay/rp-session-detail.d.ts +17 -0
  96. package/dist/app/roleplay/rp-session-detail.js +179 -0
  97. package/dist/app/roleplay/rp-session-detail.js.map +1 -0
  98. package/dist/app/roleplay/types.cjs +19 -0
  99. package/dist/app/roleplay/types.cjs.map +1 -0
  100. package/dist/app/roleplay/types.d.cts +42 -0
  101. package/dist/app/roleplay/types.d.ts +42 -0
  102. package/dist/app/roleplay/types.js +2 -0
  103. package/dist/app/roleplay/types.js.map +1 -0
  104. package/dist/app/roleplay/utils/report-parse.cjs +285 -0
  105. package/dist/app/roleplay/utils/report-parse.cjs.map +1 -0
  106. package/dist/app/roleplay/utils/report-parse.d.cts +57 -0
  107. package/dist/app/roleplay/utils/report-parse.d.ts +57 -0
  108. package/dist/app/roleplay/utils/report-parse.js +8 -0
  109. package/dist/app/roleplay/utils/report-parse.js.map +1 -0
  110. package/dist/app/roleplay/utils/report-parse.test.cjs +491 -0
  111. package/dist/app/roleplay/utils/report-parse.test.cjs.map +1 -0
  112. package/dist/app/roleplay/utils/report-parse.test.d.cts +2 -0
  113. package/dist/app/roleplay/utils/report-parse.test.d.ts +2 -0
  114. package/dist/app/roleplay/utils/report-parse.test.js +237 -0
  115. package/dist/app/roleplay/utils/report-parse.test.js.map +1 -0
  116. package/dist/app/roleplay/utils/session-utils.cjs +204 -0
  117. package/dist/app/roleplay/utils/session-utils.cjs.map +1 -0
  118. package/dist/app/roleplay/utils/session-utils.d.cts +38 -0
  119. package/dist/app/roleplay/utils/session-utils.d.ts +38 -0
  120. package/dist/app/roleplay/utils/session-utils.js +46 -0
  121. package/dist/app/roleplay/utils/session-utils.js.map +1 -0
  122. package/dist/chunk-32WIS4L7.js +131 -0
  123. package/dist/chunk-32WIS4L7.js.map +1 -0
  124. package/dist/chunk-3UGBMKSQ.js +166 -0
  125. package/dist/chunk-3UGBMKSQ.js.map +1 -0
  126. package/dist/chunk-4YAA25AV.js +161 -0
  127. package/dist/chunk-4YAA25AV.js.map +1 -0
  128. package/dist/chunk-5QIT4URV.js +87 -0
  129. package/dist/chunk-5QIT4URV.js.map +1 -0
  130. package/dist/chunk-6YIKOYBQ.js +185 -0
  131. package/dist/chunk-6YIKOYBQ.js.map +1 -0
  132. package/dist/chunk-7MXY3D3Z.js +84 -0
  133. package/dist/chunk-7MXY3D3Z.js.map +1 -0
  134. package/dist/chunk-EBFQFOUQ.js +138 -0
  135. package/dist/chunk-EBFQFOUQ.js.map +1 -0
  136. package/dist/chunk-EHDUKUML.js +183 -0
  137. package/dist/chunk-EHDUKUML.js.map +1 -0
  138. package/dist/{chunk-NEJCZABQ.js → chunk-FJEDSUGU.js} +7 -7
  139. package/dist/chunk-GA6W62DO.js +101 -0
  140. package/dist/chunk-GA6W62DO.js.map +1 -0
  141. package/dist/chunk-KJPBBBVK.js +142 -0
  142. package/dist/chunk-KJPBBBVK.js.map +1 -0
  143. package/dist/{chunk-TQTCT7DC.js → chunk-LRNO4W2P.js} +5 -5
  144. package/dist/{chunk-6DWUGXSY.js → chunk-N242VJOP.js} +2 -2
  145. package/dist/chunk-NKW6BO5R.js +264 -0
  146. package/dist/chunk-NKW6BO5R.js.map +1 -0
  147. package/dist/{chunk-R5UDNKV2.js → chunk-O332K3SW.js} +2 -2
  148. package/dist/chunk-OUP3VFXG.js +1 -0
  149. package/dist/chunk-OUP3VFXG.js.map +1 -0
  150. package/dist/chunk-QMAINJ4G.js +190 -0
  151. package/dist/chunk-QMAINJ4G.js.map +1 -0
  152. package/dist/{chunk-KLJVIEFW.js → chunk-SOKGYD5B.js} +7 -7
  153. package/dist/chunk-TFJJKM3W.js +261 -0
  154. package/dist/chunk-TFJJKM3W.js.map +1 -0
  155. package/dist/{chunk-KQ3ME6XY.js → chunk-U2EAXN3Y.js} +4 -4
  156. package/dist/chunk-UXAEOCOH.js +150 -0
  157. package/dist/chunk-UXAEOCOH.js.map +1 -0
  158. package/dist/chunk-YHP75Y5K.js +242 -0
  159. package/dist/chunk-YHP75Y5K.js.map +1 -0
  160. package/dist/chunk-ZE36DFOC.js +142 -0
  161. package/dist/chunk-ZE36DFOC.js.map +1 -0
  162. package/dist/index.css +76 -0
  163. package/dist/index.js +32 -32
  164. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +5 -5
  165. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +2 -2
  166. package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.js +7 -7
  167. package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +8 -8
  168. package/dist/molecules/curriculumV2/CurriculumContents/index.js +9 -9
  169. package/dist/molecules/curriculumV2/index.js +11 -11
  170. package/dist/molecules/dynamic-form-editor.js +2 -2
  171. package/dist/molecules/index.js +29 -29
  172. package/package.json +28 -2
  173. package/src/app/roleplay/chart/session-chart.tsx +185 -0
  174. package/src/app/roleplay/index.ts +8 -0
  175. package/src/app/roleplay/parts/analysis-section.tsx +98 -0
  176. package/src/app/roleplay/parts/coaching-panel.tsx +101 -0
  177. package/src/app/roleplay/parts/content.tsx +146 -0
  178. package/src/app/roleplay/parts/header.tsx +168 -0
  179. package/src/app/roleplay/parts/score-summary.tsx +158 -0
  180. package/src/app/roleplay/parts/score-trend-section.tsx +265 -0
  181. package/src/app/roleplay/parts/script-transcript.tsx +190 -0
  182. package/src/app/roleplay/parts/section-nav.tsx +299 -0
  183. package/src/app/roleplay/parts/session-replay-dialog.tsx +168 -0
  184. package/src/app/roleplay/parts/step-detail.tsx +173 -0
  185. package/src/app/roleplay/parts/step-radar.tsx +80 -0
  186. package/src/app/roleplay/parts/step-summary.tsx +149 -0
  187. package/src/app/roleplay/rp-session-detail.tsx +176 -0
  188. package/src/app/roleplay/types.ts +61 -0
  189. package/src/app/roleplay/utils/report-parse.test.ts +268 -0
  190. package/src/app/roleplay/utils/report-parse.ts +443 -0
  191. package/src/app/roleplay/utils/session-utils.ts +215 -0
  192. package/src/constrant/trainingLog.dummy.json +1 -0
  193. /package/dist/{chunk-NEJCZABQ.js.map → chunk-FJEDSUGU.js.map} +0 -0
  194. /package/dist/{chunk-TQTCT7DC.js.map → chunk-LRNO4W2P.js.map} +0 -0
  195. /package/dist/{chunk-6DWUGXSY.js.map → chunk-N242VJOP.js.map} +0 -0
  196. /package/dist/{chunk-R5UDNKV2.js.map → chunk-O332K3SW.js.map} +0 -0
  197. /package/dist/{chunk-KLJVIEFW.js.map → chunk-SOKGYD5B.js.map} +0 -0
  198. /package/dist/{chunk-KQ3ME6XY.js.map → chunk-U2EAXN3Y.js.map} +0 -0
@@ -0,0 +1,101 @@
1
+ 'use client';
2
+
3
+ import { Box, Card, Flex, Grid, Heading, Typo } from '../../../atoms';
4
+ import type { RpReportSkill } from '../utils/report-parse';
5
+
6
+ export interface CoachingPanelProps {
7
+ skills: RpReportSkill[];
8
+ }
9
+
10
+ function Section({
11
+ title,
12
+ desc,
13
+ children,
14
+ }: {
15
+ title: string;
16
+ desc?: string;
17
+ children: React.ReactNode;
18
+ }): React.ReactElement {
19
+ return (
20
+ <section>
21
+ <Box mb="3">
22
+ <Heading
23
+ size={{ initial: '4', md: '5' }}
24
+ style={{ textWrap: 'balance' }}
25
+ weight="bold"
26
+ >
27
+ {title}
28
+ </Heading>
29
+ {desc ? (
30
+ <Box mt="1" style={{ maxWidth: '65ch' }}>
31
+ <Typo as="p" color="gray" variant="body">
32
+ {desc}
33
+ </Typo>
34
+ </Box>
35
+ ) : null}
36
+ </Box>
37
+ {children}
38
+ </section>
39
+ );
40
+ }
41
+
42
+ export function CoachingPanel({ skills }: CoachingPanelProps): React.ReactElement | null {
43
+ if (skills.length === 0) return null;
44
+ return (
45
+ <Section desc="다음 재도전에 바로 쓸 대화 기술" title="즉시 적용 스킬">
46
+ <Grid columns="1" gap="6">
47
+ {skills.map((skill, index) => (
48
+ <Card
49
+ key={skill.title}
50
+ style={{ padding: 'var(--space-3)' }}
51
+ variant="surface"
52
+ >
53
+ <Flex align="center" gap="2">
54
+ <Flex
55
+ align="center"
56
+ justify="center"
57
+ style={{
58
+ width: 22,
59
+ height: 22,
60
+ borderRadius: 'var(--radius-full)',
61
+ background: 'var(--accent-9)',
62
+ flexShrink: 0,
63
+ }}
64
+ >
65
+ <Typo
66
+ as="span"
67
+ mono
68
+ style={{ color: 'var(--accent-contrast)' }}
69
+ variant="body"
70
+ weight="bold"
71
+ >
72
+ {index + 1}
73
+ </Typo>
74
+ </Flex>
75
+ <Typo as="span" variant="body" weight="medium">
76
+ {skill.title}
77
+ </Typo>
78
+ </Flex>
79
+ <Box mt="2" style={{ maxWidth: '65ch' }}>
80
+ <Typo as="p" variant="body">
81
+ {skill.description}
82
+ </Typo>
83
+ </Box>
84
+ <Box
85
+ mt="2"
86
+ p="2"
87
+ style={{
88
+ borderRadius: 'var(--radius-2)',
89
+ background: 'var(--accent-a2)',
90
+ }}
91
+ >
92
+ <Typo as="p" style={{ color: 'var(--accent-11)' }} variant="body">
93
+ {skill.example}
94
+ </Typo>
95
+ </Box>
96
+ </Card>
97
+ ))}
98
+ </Grid>
99
+ </Section>
100
+ );
101
+ }
@@ -0,0 +1,146 @@
1
+ 'use client';
2
+
3
+ import React from 'react';
4
+ import { Box, Flex, Grid, Heading, Separator, Typo } from '../../../atoms';
5
+ import type { RpSessionDetailData, RpSessionHistoryItem } from '../types';
6
+ import type { RpReport } from '../utils/report-parse';
7
+ import { hasStepSignal } from '../utils/session-utils';
8
+ import type { SpeechShare } from '../utils/session-utils';
9
+ import { AnalysisSection, Section } from './analysis-section';
10
+ import { CoachingPanel } from './coaching-panel';
11
+ import { ScoreSummary } from './score-summary';
12
+ import { ScoreTrendSection } from './score-trend-section';
13
+ import { SectionNav } from './section-nav';
14
+ import type { SectionNavItem } from './section-nav';
15
+ import { StepDetail } from './step-detail';
16
+ import { StepSummary } from './step-summary';
17
+
18
+ export interface ContentProps {
19
+ detail: RpSessionDetailData;
20
+ report: RpReport;
21
+ history: RpSessionHistoryItem[];
22
+ speechShare: SpeechShare | null;
23
+ scrollMarginTop: string;
24
+ }
25
+
26
+ export function Content({
27
+ detail,
28
+ report,
29
+ history,
30
+ speechShare,
31
+ scrollMarginTop,
32
+ }: ContentProps): React.ReactElement {
33
+ const { steps, skills, strengths, improvements } = report;
34
+ const scoreValue = detail.totalScore ?? report.totalScore;
35
+
36
+ const showTrend = history.length > 1;
37
+ const showStepSummary = steps.length > 0 && steps.some(hasStepSignal);
38
+ const showStepDetail = steps.length > 0;
39
+
40
+ const navItems: SectionNavItem[] = [
41
+ { id: 'score-summary', label: '종합 점수', score: scoreValue, max: 100 },
42
+ ...(strengths.length > 0 ? [{ id: 'strengths', label: '강점' }] : []),
43
+ ...(improvements.length > 0 ? [{ id: 'improvements', label: '개선점' }] : []),
44
+ ...(showTrend ? [{ id: 'score-trend', label: '총점 추이' }] : []),
45
+ ...(showStepSummary ? [{ id: 'step-summary', label: '평가 단계 요약' }] : []),
46
+ ...(showStepDetail ? [{ id: 'step-detail', label: '단계별 상세 분석' }] : []),
47
+ ...(skills.length > 0 ? [{ id: 'coaching', label: '즉시 적용 스킬' }] : []),
48
+ ];
49
+
50
+ return (
51
+ <Grid
52
+ align="start"
53
+ columns={{ initial: '1', md: 'minmax(0, 1fr) 224px' }}
54
+ gap="7"
55
+ >
56
+ <Flex direction="column" gap="7">
57
+ {report.frameworkTitle !== null || report.frameworkDescription !== null ? (
58
+ <Box>
59
+ {report.frameworkTitle !== null ? (
60
+ <Heading size="5" weight="bold">
61
+ {report.frameworkTitle}
62
+ </Heading>
63
+ ) : null}
64
+ {report.frameworkDescription !== null ? (
65
+ <Box mt={report.frameworkTitle !== null ? '2' : '0'}>
66
+ <Typo as="p" variant="body">
67
+ {report.frameworkDescription}
68
+ </Typo>
69
+ </Box>
70
+ ) : null}
71
+ </Box>
72
+ ) : null}
73
+
74
+ <Box id="score-summary" style={{ scrollMarginTop }}>
75
+ <ScoreSummary detail={detail} report={report} speechShare={speechShare} />
76
+ </Box>
77
+
78
+ {strengths.length > 0 ? (
79
+ <Box id="strengths" style={{ scrollMarginTop }}>
80
+ <AnalysisSection
81
+ desc="이번 세션에서 잘한 점"
82
+ items={strengths}
83
+ title="강점"
84
+ tone="good"
85
+ />
86
+ </Box>
87
+ ) : null}
88
+
89
+ {improvements.length > 0 ? (
90
+ <Box id="improvements" style={{ scrollMarginTop }}>
91
+ <AnalysisSection
92
+ desc="다음 시도에서 보완할 점"
93
+ items={improvements}
94
+ title="개선점"
95
+ tone="bad"
96
+ />
97
+ </Box>
98
+ ) : null}
99
+
100
+ {showTrend ? (
101
+ <Box id="score-trend" style={{ scrollMarginTop }}>
102
+ <ScoreTrendSection history={history} />
103
+ </Box>
104
+ ) : null}
105
+
106
+ {showStepSummary ? (
107
+ <Box id="step-summary" style={{ scrollMarginTop }}>
108
+ <StepSummary steps={steps} />
109
+ </Box>
110
+ ) : null}
111
+
112
+ {showStepDetail ? (
113
+ <Box id="step-detail" style={{ scrollMarginTop }}>
114
+ <Section
115
+ desc="대화 프레임워크 단계별 평가 결과입니다."
116
+ title="단계별 상세 분석"
117
+ >
118
+ <Flex direction="column">
119
+ {steps.map((step, i) => (
120
+ <Box key={step.key}>
121
+ {i > 0 ? (
122
+ <Separator
123
+ mb="6"
124
+ size="4"
125
+ style={{ marginTop: 'calc(var(--space-9) * 1.6)' }}
126
+ />
127
+ ) : null}
128
+ <StepDetail scrollMarginTop={scrollMarginTop} step={step} />
129
+ </Box>
130
+ ))}
131
+ </Flex>
132
+ </Section>
133
+ </Box>
134
+ ) : null}
135
+
136
+ {skills.length > 0 ? (
137
+ <Box id="coaching" style={{ scrollMarginTop }}>
138
+ <CoachingPanel skills={skills} />
139
+ </Box>
140
+ ) : null}
141
+ </Flex>
142
+
143
+ <SectionNav items={navItems} steps={showStepDetail ? steps : []} />
144
+ </Grid>
145
+ );
146
+ }
@@ -0,0 +1,168 @@
1
+ 'use client';
2
+
3
+ import { Badge, Box, Button, Flex, Heading, Typo } from '../../../atoms';
4
+ import type { RpSessionDetailData } from '../types';
5
+ import { formatDate, formatDuration, statusLabelOf } from '../utils/session-utils';
6
+
7
+ export interface HeaderProps {
8
+ detail: RpSessionDetailData;
9
+ hasScript: boolean;
10
+ onOpenReplay: () => void;
11
+ onResolveMediaUrl?: (
12
+ rawUrl: string,
13
+ options: { disposition: 'inline' | 'attachment' }
14
+ ) => string | Promise<string>;
15
+ }
16
+
17
+ function PdfIcon(): React.ReactElement {
18
+ return (
19
+ <svg
20
+ aria-hidden="true"
21
+ fill="none"
22
+ height="13"
23
+ stroke="currentColor"
24
+ strokeLinecap="round"
25
+ strokeLinejoin="round"
26
+ strokeWidth="2"
27
+ viewBox="0 0 24 24"
28
+ width="13"
29
+ >
30
+ <path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" />
31
+ <path d="M14 3v5h5" />
32
+ <path d="M12 12v5" />
33
+ <path d="M9.5 14.5 12 17l2.5-2.5" />
34
+ </svg>
35
+ );
36
+ }
37
+
38
+ function VideoIcon(): React.ReactElement {
39
+ return (
40
+ <svg
41
+ aria-hidden="true"
42
+ fill="none"
43
+ height="13"
44
+ stroke="currentColor"
45
+ strokeLinecap="round"
46
+ strokeLinejoin="round"
47
+ strokeWidth="2"
48
+ viewBox="0 0 24 24"
49
+ width="13"
50
+ >
51
+ <rect height="12" rx="2" width="13" x="2" y="6" />
52
+ <path d="m15 10 6-3v10l-6-3z" />
53
+ </svg>
54
+ );
55
+ }
56
+
57
+ export function Header({
58
+ detail,
59
+ hasScript,
60
+ onOpenReplay,
61
+ onResolveMediaUrl,
62
+ }: HeaderProps): React.ReactElement {
63
+ const pdfHref = detail.trainingLogURL;
64
+ const hasReplayMedia = Boolean(
65
+ detail.trainingVideoURL || detail.trainingAudioURL
66
+ );
67
+
68
+ const handlePdfClick = (): void => {
69
+ if (!pdfHref || !onResolveMediaUrl) return;
70
+ void Promise.resolve(
71
+ onResolveMediaUrl(pdfHref, { disposition: 'attachment' })
72
+ ).then((url) => {
73
+ window.open(url, '_blank');
74
+ });
75
+ };
76
+
77
+ const replayActive = hasScript && hasReplayMedia;
78
+
79
+ return (
80
+ <Box>
81
+ <Flex
82
+ align={{ md: 'start' }}
83
+ direction={{ initial: 'column', md: 'row' }}
84
+ gap="4"
85
+ justify="between"
86
+ >
87
+ <Box style={{ minWidth: 0 }}>
88
+ <Flex align="center" gap="2" mb="2" wrap="wrap">
89
+ <Badge color="neutral" size="small" variant="soft">
90
+ {statusLabelOf(detail.status)}
91
+ </Badge>
92
+ <Typo as="span" style={{ color: 'var(--gray-11)' }} variant="body">
93
+ {detail.trainingSessionNum}회차
94
+ {detail.characterTitle ? ` · ${detail.characterTitle}` : ''}
95
+ </Typo>
96
+ </Flex>
97
+ <Heading
98
+ size={{ initial: '5', md: '7' }}
99
+ style={{ textWrap: 'balance' }}
100
+ weight="bold"
101
+ >
102
+ {detail.scenarioTitle ?? '롤플레잉 세션'}
103
+ </Heading>
104
+ <Typo as="p" color="gray" mono mt="1" variant="body">
105
+ {formatDate(detail.createdAt)} · {formatDuration(detail.trainingTime)}
106
+ </Typo>
107
+ </Box>
108
+ <Flex
109
+ gap="2"
110
+ justify={{ initial: 'start', md: 'end' }}
111
+ style={{ flexShrink: 0 }}
112
+ wrap="wrap"
113
+ >
114
+ {onResolveMediaUrl ? (
115
+ <Button
116
+ color="gray"
117
+ disabled={!pdfHref}
118
+ onClick={pdfHref ? handlePdfClick : undefined}
119
+ size={{ initial: 'small', md: 'medium' }}
120
+ title={pdfHref ? undefined : '산출물 없음'}
121
+ type="button"
122
+ variant="outline"
123
+ >
124
+ <PdfIcon />
125
+ <span style={{ whiteSpace: 'nowrap' }}>PDF 다운로드</span>
126
+ </Button>
127
+ ) : (
128
+ <Button
129
+ asChild={Boolean(pdfHref)}
130
+ color="gray"
131
+ disabled={!pdfHref}
132
+ size={{ initial: 'small', md: 'medium' }}
133
+ title={pdfHref ? undefined : '산출물 없음'}
134
+ type="button"
135
+ variant="outline"
136
+ >
137
+ {pdfHref ? (
138
+ <a href={pdfHref} rel="noopener noreferrer" target="_blank">
139
+ <PdfIcon />
140
+ <span style={{ whiteSpace: 'nowrap' }}>PDF 다운로드</span>
141
+ </a>
142
+ ) : (
143
+ <span>
144
+ <PdfIcon />
145
+ <span style={{ whiteSpace: 'nowrap' }}>PDF 다운로드</span>
146
+ </span>
147
+ )}
148
+ </Button>
149
+ )}
150
+ {hasScript ? (
151
+ <Button
152
+ color="gray"
153
+ disabled={!replayActive}
154
+ onClick={onOpenReplay}
155
+ size={{ initial: 'small', md: 'medium' }}
156
+ title={replayActive ? undefined : '다시보기 없음'}
157
+ type="button"
158
+ variant="outline"
159
+ >
160
+ <VideoIcon />
161
+ <span style={{ whiteSpace: 'nowrap' }}>영상</span>
162
+ </Button>
163
+ ) : null}
164
+ </Flex>
165
+ </Flex>
166
+ </Box>
167
+ );
168
+ }
@@ -0,0 +1,158 @@
1
+ 'use client';
2
+
3
+ import { Box, Card, Flex, Grid, Separator, Typo } from '../../../atoms';
4
+ import type { RpReport } from '../utils/report-parse';
5
+ import type { RpSessionDetailData } from '../types';
6
+ import { SPEECH_OVERTALK_THRESHOLD, type SpeechShare } from '../utils/session-utils';
7
+
8
+ export interface ScoreSummaryProps {
9
+ detail: RpSessionDetailData;
10
+ report: RpReport;
11
+ speechShare: SpeechShare | null;
12
+ }
13
+
14
+ function SpeechShareBar({ share }: { share: SpeechShare }): React.ReactElement {
15
+ const isOvertalking = share.userPct > SPEECH_OVERTALK_THRESHOLD;
16
+ return (
17
+ <Box>
18
+ <Flex align="center" justify="between" mb="1">
19
+ <Typo
20
+ as="span"
21
+ style={{
22
+ fontSize: '0.75rem',
23
+ color: isOvertalking ? 'var(--red-11)' : 'var(--accent-11)',
24
+ }}
25
+ variant="body"
26
+ weight="medium"
27
+ >
28
+ 내 발화량 {share.userPct}%
29
+ </Typo>
30
+ <Typo
31
+ as="span"
32
+ color="gray"
33
+ style={{ fontSize: '0.75rem' }}
34
+ variant="body"
35
+ >
36
+ 상대 {share.partnerPct}%
37
+ </Typo>
38
+ </Flex>
39
+ <Flex
40
+ style={{
41
+ height: 6,
42
+ borderRadius: 'var(--radius-1)',
43
+ overflow: 'hidden',
44
+ background: 'var(--gray-4)',
45
+ }}
46
+ >
47
+ <Box
48
+ style={{
49
+ width: `${share.userPct}%`,
50
+ background: isOvertalking ? 'var(--red-9)' : 'var(--accent-9)',
51
+ }}
52
+ />
53
+ </Flex>
54
+ {isOvertalking ? (
55
+ <Typo
56
+ as="p"
57
+ mt="1"
58
+ style={{ fontSize: '0.75rem', color: 'var(--red-11)' }}
59
+ variant="body"
60
+ >
61
+ 상대의 말을 더 듣고 질문·경청의 비중을 높여 보세요
62
+ </Typo>
63
+ ) : null}
64
+ </Box>
65
+ );
66
+ }
67
+
68
+ export function ScoreSummary({
69
+ detail,
70
+ report,
71
+ speechShare,
72
+ }: ScoreSummaryProps): React.ReactElement {
73
+ const scoreValue = detail.totalScore ?? report.totalScore;
74
+ const comment = report.comment;
75
+
76
+ return (
77
+ <Grid
78
+ align="start"
79
+ columns={comment ? { initial: '1', md: 'minmax(0, 240px) 1fr' } : '1'}
80
+ gap="5"
81
+ >
82
+ <Card variant="surface">
83
+ <Flex align="center" direction="column" gap="2" py="3">
84
+ <Typo as="p" color="gray" variant="body" weight="medium">
85
+ 종합 점수
86
+ </Typo>
87
+ <Flex align="baseline" gap="1">
88
+ <Typo
89
+ as="span"
90
+ mono
91
+ style={{
92
+ color: 'var(--gray-12)',
93
+ fontSize: '3.75rem',
94
+ lineHeight: 1.1,
95
+ }}
96
+ weight="bold"
97
+ >
98
+ {scoreValue ?? '—'}
99
+ </Typo>
100
+ <Typo as="span" color="gray" mono variant="subtitle">
101
+ /100
102
+ </Typo>
103
+ </Flex>
104
+ </Flex>
105
+ {speechShare ? (
106
+ <>
107
+ <Separator my="3" size="4" />
108
+ <SpeechShareBar share={speechShare} />
109
+ </>
110
+ ) : null}
111
+ </Card>
112
+
113
+ {comment ? (
114
+ <Flex direction="column" gap="3">
115
+ <Typo as="p" variant="body" weight="medium">
116
+ 종합 분석
117
+ </Typo>
118
+ <Box style={{ maxWidth: '65ch' }}>
119
+ <Typo as="p" variant="body">
120
+ {comment}
121
+ </Typo>
122
+ </Box>
123
+ {report.deduction ? (
124
+ <Box
125
+ pl="3"
126
+ pr="3"
127
+ py="2"
128
+ style={{
129
+ borderLeft: '2px solid var(--amber-a6)',
130
+ background: 'var(--amber-a2)',
131
+ borderRadius: 'var(--radius-2)',
132
+ }}
133
+ >
134
+ <Typo
135
+ as="p"
136
+ mono
137
+ style={{ color: 'var(--amber-11)' }}
138
+ variant="body"
139
+ weight="medium"
140
+ >
141
+ 감점 {report.deduction.score}점
142
+ </Typo>
143
+ <Box mt="1" style={{ maxWidth: '65ch' }}>
144
+ <Typo
145
+ as="p"
146
+ style={{ color: 'var(--amber-11)' }}
147
+ variant="body"
148
+ >
149
+ {report.deduction.basis}
150
+ </Typo>
151
+ </Box>
152
+ </Box>
153
+ ) : null}
154
+ </Flex>
155
+ ) : null}
156
+ </Grid>
157
+ );
158
+ }