@@ -56,7 +56,7 @@ export function PostsManagerPage() {
5656 const { tags } = useTags ( ) ;
5757 const { selectedTag, setTag : setSelectedTag } = useTagFilter ( queryParams . get ( 'tag' ) || '' ) ;
5858 const [ selectedComment , setSelectedComment ] = useState < Comment | null > ( null ) ;
59- // 댓글 입력 상태는 feature dialog 내부에서 관리
59+
6060 const [ showAddCommentDialog , setShowAddCommentDialog ] = useState ( false ) ;
6161 const [ showEditCommentDialog , setShowEditCommentDialog ] = useState ( false ) ;
6262 const postDetail = usePostDetail ( ) ;
@@ -71,25 +71,16 @@ export function PostsManagerPage() {
7171 sortOrder : ( sortOrder as any ) || 'asc' ,
7272 } ) ;
7373
74- // URL 업데이트 함수
7574 const updateURL = ( ) => {
7675 updateUrl ( navigate , { skip, limit, search : searchQuery , sortBy, sortOrder, tag : selectedTag } ) ;
7776 } ;
7877
79- // 게시물 추가/수정은 feature UI에서 처리
80-
81- // 게시물 삭제 후처리 (feature에서 삭제 수행 후 호출됨)
8278 const onPostDeleted = async ( _id : number ) => {
8379 void refetch ( ) ;
8480 } ;
8581
86- // 댓글 데이터는 useComments 훅에서 관리
87-
88- // 댓글 기능 훅 사용
8982 const commentsFeature = useComments ( selectedPost ?. id ?? null ) ;
90- // 댓글 추가/수정은 feature dialog에서 처리
9183
92- // 댓글 삭제
9384 const deleteComment = async ( id : number ) => {
9485 try {
9586 await commentsFeature . remove ( id ) ;
@@ -98,7 +89,6 @@ export function PostsManagerPage() {
9889 }
9990 } ;
10091
101- // 댓글 좋아요
10292 const likeComment = async ( id : number ) => {
10393 try {
10494 await commentsFeature . like ( id ) ;
@@ -107,20 +97,16 @@ export function PostsManagerPage() {
10797 }
10898 } ;
10999
110- // 게시물 상세 보기
111100 const openPostDetail = ( post : Post ) => {
112101 setSelectedPost ( post ) ;
113102 postDetail . show ( post ) ;
114103 } ;
115104
116- // 사용자 모달 열기 (feature 사용)
117105 const openUserModal = async ( user : User ) => {
118106 if ( ! user ?. id ) return ;
119107 await userModal . show ( user . id ) ;
120108 } ;
121109
122- // 태그는 useTags 훅에서 초기 로딩
123-
124110 useEffect ( ( ) => {
125111 updateURL ( ) ;
126112 } , [ skip , limit , sortBy , sortOrder , selectedTag , searchQuery ] ) ;
@@ -149,7 +135,6 @@ export function PostsManagerPage() {
149135 setSkip ,
150136 ] ) ;
151137
152- // 게시물 테이블 렌더링 (Feature UI 사용)
153138 const renderPostTable = ( ) => (
154139 < PostTable
155140 posts = { posts }
@@ -170,7 +155,6 @@ export function PostsManagerPage() {
170155 />
171156 ) ;
172157
173- // 댓글 렌더링
174158 const renderComments = ( ) => (
175159 < div className = 'mt-2' >
176160 < div className = 'flex items-center justify-between mb-2' >
@@ -210,7 +194,6 @@ export function PostsManagerPage() {
210194 </ Card . Header >
211195 < Card . Content >
212196 < div className = 'flex flex-col gap-4' >
213- { /* 검색 및 필터 컨트롤 (Feature UI 사용) */ }
214197 < div className = 'flex gap-4' >
215198 < div className = 'flex-1' >
216199 < SearchInput value = { searchQuery } onChange = { setQuery } onEnter = { ( ) => void refetch ( ) } />
@@ -231,10 +214,8 @@ export function PostsManagerPage() {
231214 />
232215 </ div >
233216
234- { /* 게시물 테이블 */ }
235217 { loading ? < div className = 'flex justify-center p-4' > 로딩 중...</ div > : renderPostTable ( ) }
236218
237- { /* 페이지네이션 (Feature UI 사용) */ }
238219 < PaginationControls
239220 limit = { limit }
240221 skip = { skip }
@@ -260,7 +241,6 @@ export function PostsManagerPage() {
260241 onSuccess = { ( ) => void commentsFeature . refetch ( ) }
261242 />
262243
263- { /* 게시물 상세 보기 대화상자 (Feature UI) */ }
264244 < PostDetailDialog
265245 open = { postDetail . open }
266246 post = { postDetail . post }
@@ -272,7 +252,6 @@ export function PostsManagerPage() {
272252 { postDetail . post ? renderComments ( ) : null }
273253 </ PostDetailDialog >
274254
275- { /* Feature Dialogs */ }
276255 < AddPostDialog
277256 open = { showAddDialog }
278257 onOpenChange = { setShowAddDialog }
@@ -285,7 +264,6 @@ export function PostsManagerPage() {
285264 onSuccess = { ( ) => void refetch ( ) }
286265 />
287266
288- { /* 사용자 모달 (Feature UI 사용) */ }
289267 < UserModal
290268 open = { userModal . open }
291269 user = { userModal . user }
0 commit comments