+ {/* setActiveReplyIdx: 같은 댓글 다시 누르면 닫기(toggle)
+ setReplyText: 새로 열 때 입력 초기화(원하면 제거) */}
+
+
+ {/* 답글 버튼 밑에 inputBox렌더링 */}
+ {activeReplyIdx === idx && (
+
+ setReplyText(e.target.value)}
+ placeholder="답글을 입력하세요"
+ className="flex-1 h-10 px-3 rounded-lg border border-zinc-200 text-sm outline-none focus:border-indigo-500"
+ />
+ {/* 서버 붙기 전: 아무 것도 안 하고 닫기만 */}
+
+
+ )}
+
+
+
+ );
+ })}
+
+
+ >
+ )}
+
+
+
+ {/* 전체 Script Box 내려갔다 올라오게 */}
+
+
+
+
+ {/* "대본 입력 영역" textarea */}
+
+
+
+
+ >
+ );
+};
+
+export default ScriptBox;
diff --git a/src/components/script-box/Opinion.tsx b/src/components/script-box/Opinion.tsx
new file mode 100644
index 00000000..7cd9557b
--- /dev/null
+++ b/src/components/script-box/Opinion.tsx
@@ -0,0 +1,170 @@
+import React from 'react';
+
+import replyIcon from '../../assets/icons/replyIcon.svg';
+import treshcanIcon from '../../assets/icons/treshcanIcon.svg';
+
+type OpinionProps = {
+ opinion: {
+ value: boolean;
+ toggle: () => void;
+ off: () => void;
+ };
+
+ activeReplyIdx: number | null;
+ setActiveReplyIdx: React.Dispatch>;
+ replyText: string;
+ // React.SetStateAction : 상태를 바꾸는 set 함수의 타입은 이런 식으로 명시함
+ setReplyText: React.Dispatch>;
+};
+
+const Opinion = ({
+ opinion,
+ activeReplyIdx,
+ setActiveReplyIdx,
+ replyText,
+ setReplyText,
+}: OpinionProps) => {
+ return (
+
+ {/* (기존 그대로) 의견 버튼 */}
+
+
+ {/* (기존 그대로) 의견 popover */}
+ {opinion.value && (
+ <>
+ {/* 바깥 클릭 시 닫기 */}
+
+
+
+ {/* ✅ 기존 로직 그대로 유지
+ - setActiveReplyIdx: 같은 댓글 다시 누르면 닫기(toggle)
+ - setReplyText: 새로 열 때 입력 초기화 */}
+
+
+ {/* 답글 inputBox 렌더링 */}
+ {activeReplyIdx === idx && (
+
+ setReplyText(e.target.value)}
+ placeholder="답글을 입력하세요"
+ className="flex-1 h-10 px-3 rounded-lg border border-zinc-200 text-sm outline-none focus:border-indigo-500"
+ />
+ {/* 서버 붙기 전: 아무 것도 안 하고 닫기만 */}
+
+