@@ -4,9 +4,11 @@ import Card from '@/components/common/Card';
44import ChatbotHelperBox from '@/components/shared/ToDo/ChatbotHelperBox' ;
55import TodoItem from '@/components/shared/ToDo/TodoItem' ;
66import TodoPopup from '@/components/shared/ToDo/TodoPopup' ;
7+ import { cn } from '@/lib/utils' ;
78import { todoListData } from '@/mocks/data' ;
89import { useModalStore } from '@/stores/modal' ;
910import { useTodoEditStore } from '@/stores/todoEditStore' ;
11+ import { useMemoStore } from '@/stores/useMemoStore' ;
1012import { useTodoListStore } from '@/stores/useTodoListStore' ;
1113import { Memo } from '@/types/memo' ;
1214import { Todo } from '@/types/todo' ;
@@ -18,9 +20,9 @@ type Props = {
1820} ;
1921
2022export const TodoAndMemoSection = ( { todos, memos } : Props ) => {
21- // const { todoList } = useTodoListStore();
2223 const { openModal } = useModalStore ( ) ;
2324 const { setEditingTodo } = useTodoEditStore ( ) ;
25+ const { memoList } = useMemoStore ( ) ;
2426 const handleOpenTodoModal = ( ) => {
2527 setEditingTodo ( null ) ;
2628 openModal ( {
@@ -46,16 +48,25 @@ export const TodoAndMemoSection = ({ todos, memos }: Props) => {
4648 </ ActionButton >
4749 </ div >
4850 </ div >
49- < div className = "flex flex-col gap-4 h-[300px] overflow-y-auto scrollbar-hide" >
50- { memos . map ( ( memo ) => (
51- < div
52- key = { memo . id }
53- className = "flex flex-col justify-center w-full h-[96px] bg-beige-light rounded-lg p-4"
54- >
55- < div className = "text-xl font-bold text-secondary" > { memo . title } </ div >
56- < div className = "text-lg text-primary" > { memo . content } </ div >
57- </ div >
58- ) ) }
51+ < div
52+ className = { cn (
53+ 'flex flex-col gap-4 h-[300px] overflow-y-auto scrollbar-hide' ,
54+ memoList . length === 0 && 'h-full'
55+ ) }
56+ >
57+ { memoList . length > 0 ? (
58+ memoList . map ( ( memo ) => (
59+ < div
60+ key = { memo . id }
61+ className = "flex flex-col justify-center w-full h-[96px] bg-beige-light rounded-lg p-4"
62+ >
63+ < div className = "text-xl font-bold text-secondary" > { memo . title } </ div >
64+ < div className = "text-lg text-primary" > { memo . content } </ div >
65+ </ div >
66+ ) )
67+ ) : (
68+ < p className = "text-lg text-center text-secondary mb-2" > 메모를 추가해주세요!</ p >
69+ ) }
5970 </ div >
6071
6172 { /* todo 섹션 */ }
0 commit comments