diff --git a/app/Http/Controllers/Video/TutorialVideoController.php b/app/Http/Controllers/Video/TutorialVideoController.php index 8dfd6564..e87bb1b4 100644 --- a/app/Http/Controllers/Video/TutorialVideoController.php +++ b/app/Http/Controllers/Video/TutorialVideoController.php @@ -230,6 +230,29 @@ public function history(): JsonResponse ]); } + /** + * 이력 상세 (스크립트/분석 데이터) + */ + public function detail(int $id): JsonResponse + { + $tutorial = TutorialVideo::where('user_id', auth()->id()) + ->findOrFail($id); + + return response()->json([ + 'success' => true, + 'data' => [ + 'id' => $tutorial->id, + 'title' => $tutorial->title, + 'status' => $tutorial->status, + 'progress' => $tutorial->progress, + 'analysis_data' => $tutorial->analysis_data, + 'slides_data' => $tutorial->slides_data, + 'cost_usd' => $tutorial->cost_usd, + 'created_at' => $tutorial->created_at?->toIso8601String(), + ], + ]); + } + /** * 이력 삭제 */ diff --git a/resources/views/video/tutorial/index.blade.php b/resources/views/video/tutorial/index.blade.php index 652369e5..811d3d7d 100644 --- a/resources/views/video/tutorial/index.blade.php +++ b/resources/views/video/tutorial/index.blade.php @@ -652,6 +652,76 @@ className="px-5 py-2.5 bg-red-600 text-white rounded-lg font-medium hover:bg-red ); }; +// ============================================================ +// History Detail Panel (행 클릭 시 표시) +// ============================================================ +const HistoryDetail = ({ detail, onClose }) => { + if (!detail) return null; + + const analysis = detail.analysis_data || []; + const totalSteps = analysis.reduce((sum, s) => sum + (s.steps || []).length, 0); + const totalDuration = analysis.reduce((sum, s) => + sum + (s.steps || []).reduce((d, step) => d + (step.duration || 6), 0), 6 + ); + + return ( +
분석 데이터가 없습니다.
+ ) : ( +{step.narration || '-'}
+