From 7bd22dfd60f2a89f40737914e2b47589cfa7e447 Mon Sep 17 00:00:00 2001 From: Haemin Kim Date: Wed, 24 Sep 2025 11:04:46 +0900 Subject: [PATCH 1/9] =?UTF-8?q?=E2=9C=A8=20(#319)=20=EA=B0=95=EC=9D=98?= =?UTF-8?q?=EC=9E=90=EB=A3=8C=20API=20=EC=97=B0=EA=B2=B0,=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=ED=95=9C=20=EB=AC=B8=EC=84=9C=EA=B0=80=20=EC=97=86?= =?UTF-8?q?=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20=ED=99=94=EB=A9=B4=EC=97=90=20?= =?UTF-8?q?=EC=95=88=EB=82=B4=EA=B8=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LectureLiveHeader/LectureLiveHeader.tsx | 27 +----- .../_components/LectureLiveProvider.tsx | 6 +- .../LectureMainGrid.module.scss | 23 +++++ .../LectureMainGrid/LectureMainGrid.tsx | 61 ++++++++---- .../LectureNoteButton.module.scss | 0 .../LectureNoteButton/LectureNoteButton.tsx | 92 +++++++++++++++++++ .../LectureNotePopover/LectureNotePopover.tsx | 91 ++++++++---------- .../PageThumbsSidebar/PageThumbsSidebar.tsx | 8 ++ 8 files changed, 210 insertions(+), 98 deletions(-) create mode 100644 frontend/app/teacher/lecture-live/[lectureId]/_components/LectureNote/LectureNoteButton/LectureNoteButton.module.scss create mode 100644 frontend/app/teacher/lecture-live/[lectureId]/_components/LectureNote/LectureNoteButton/LectureNoteButton.tsx diff --git a/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureLiveHeader/LectureLiveHeader.tsx b/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureLiveHeader/LectureLiveHeader.tsx index bb6519f7..84376c12 100644 --- a/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureLiveHeader/LectureLiveHeader.tsx +++ b/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureLiveHeader/LectureLiveHeader.tsx @@ -1,22 +1,19 @@ "use client"; -import { useState, useRef, useMemo, useEffect } from "react"; +import { useState, useMemo, useEffect } from "react"; import { useRouter, useParams } from "next/navigation"; import styles from "./LectureLiveHeader.module.scss"; import FitContentButton from "@/components/Button/FitContentButton/FitContentButton"; -import IconButton from "@/components/Button/IconButton/IconButton"; import { DocumentSideButtonConnected } from "../DocumentSideButton/DocumentSideButton"; import PenToolButtons from "../PenTool/PenToolButtons/PenToolButtons"; import { useLive } from "../LectureLiveProvider"; -import { FileText } from "lucide-react"; -import ToolPopover from "../ToolPopover/ToolPopover"; -import LectureNotePopover from "../LectureNote/LectureNotePopover/LectureNotePopover"; import ChatingButton from "../Chating/ChatingButton/ChatingButton"; import RecordingButton from "../Recording/RecordingButton/RecordingButton"; import ConfirmModal from "@/components/Modal/ConfirmModal/ConfirmModal"; import { getRecordingEngine, type RecState } from "../Recording/recordingEngine"; import { ROUTES } from "@/constants/routes"; import { Tool } from "../LectureLiveProvider"; +import LectureNoteButton from "../LectureNote/LectureNoteButton/LectureNoteButton"; export default function LectureLiveHeader({ onToggleChat, @@ -28,8 +25,6 @@ export default function LectureLiveHeader({ onEndLecture?: () => void; }) { const { tool, setTool } = useLive(); - const docBtnRef = useRef(null); - const [openDoc, setOpenDoc] = useState(false); const [endOpen, setEndOpen] = useState(false); @@ -75,23 +70,7 @@ export default function LectureLiveHeader({
- - setOpenDoc((v) => !v)} - icon={} - /> - - - setOpenDoc(false)} - align="start" - side="bottom" - > - setOpenDoc(false)} /> - + diff --git a/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureLiveProvider.tsx b/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureLiveProvider.tsx index 0c0d9150..eaad3029 100644 --- a/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureLiveProvider.tsx +++ b/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureLiveProvider.tsx @@ -61,9 +61,9 @@ export function LectureLiveProvider({ children }: { children: React.ReactNode }) }); const [doc, setDocState] = useState({ - url: "/file/기말보고서_졸업을하자.pdf", - type: "pdf", - name: "기말보고서_졸업을하자.pdf", + url: "", + type: "unknown", + name: "", }); const drawStoreRef = useRef>(new Map()); diff --git a/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureMainGrid/LectureMainGrid.module.scss b/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureMainGrid/LectureMainGrid.module.scss index 44ccb2dd..7ca330f0 100644 --- a/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureMainGrid/LectureMainGrid.module.scss +++ b/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureMainGrid/LectureMainGrid.module.scss @@ -51,4 +51,27 @@ --right-col: 0px; grid-template-columns: 1fr; } +} + +.empty { + height: 100%; + display:flex; align-items:center; justify-content:center; +} +.emptyCard { + padding: 20px 24px; border:1px dashed #d6d6d6; border-radius:12px; + background:#fafafa; text-align:center; +} +.emptyTitle { font-weight:700; margin-bottom:6px; } +.emptyDesc { color:#666; } +.leftEmpty { + height:100%; display:flex; align-items:center; justify-content:center; + color:#777; font-size: 0.92rem; padding: 0 12px; text-align:center; +} + +.inlineIcon { + width: 1.2em; + height: 1.2em; + vertical-align: middle; + margin-bottom: 0.3em; + margin-right: 0.1em; } \ No newline at end of file diff --git a/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureMainGrid/LectureMainGrid.tsx b/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureMainGrid/LectureMainGrid.tsx index e0aaa8c0..d738174b 100644 --- a/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureMainGrid/LectureMainGrid.tsx +++ b/frontend/app/teacher/lecture-live/[lectureId]/_components/LectureMainGrid/LectureMainGrid.tsx @@ -5,6 +5,7 @@ import styles from "./LectureMainGrid.module.scss"; import { useLive } from "../LectureLiveProvider"; import ChatPanel from "../Chating/ChatingPanel/ChatingPanel"; import dynamic from "next/dynamic"; +import { FileText } from "lucide-react"; const PageThumbsSidebar = dynamic( () => import("../LectureNote/PageThumbsSidebar/PageThumbsSidebar"), @@ -27,7 +28,7 @@ export default function LectureMainGrid() { const [currentPage, setCurrentPage] = useState(0); const resolvedType: "pdf" | "pptx" | undefined = - doc.type === "pdf" || doc.type === "pptx" ? doc.type : undefined; + doc.type === "pdf" || doc.type === "pptx" ? doc.type : undefined; useEffect(() => { const resetOnDocChange = () => setCurrentPage(0); @@ -44,6 +45,7 @@ export default function LectureMainGrid() { const onKey = (e: KeyboardEvent) => { if (isTypingTarget(e.target)) return; + if (!doc.url) return; if (e.key === " " || e.key === "Enter" || e.key === "ArrowRight" || e.key === "ArrowDown") { e.preventDefault(); @@ -58,6 +60,21 @@ export default function LectureMainGrid() { return () => window.removeEventListener("keydown", onKey); }, [count, doc.url]); + const EmptyState = ( +
+
+
강의자료가 선택되지 않았어요
+
+ 상단의 {" "} + + + 버튼을 눌러 자료를 선택해 주세요. +
+
+
+ ); + return (
- - + {doc.url ? ( + <> + + + + ) : ( + EmptyState + )}