diff --git a/src/app/entire/page.tsx b/src/app/entire/page.tsx new file mode 100755 index 0000000..8f1b835 --- /dev/null +++ b/src/app/entire/page.tsx @@ -0,0 +1,58 @@ +"use client"; + +import { useCallback, useEffect, useState } from "react"; + +import { Class } from "@/entities/class/model/class"; +import { ClassList } from "@/entities/class/ui"; +import SkeletonCard from "@/entities/class/ui/Class/SkeletonCard/SkeletonCard"; +import useEntireClass from "@/entities/class/api/useEntireClass"; + +const EntirePage = () => { + const [classListData, setClassListData] = useState(); + + // TODO: 전체 클래스 가져오는 API로 수정 필요 + const { data, isLoading, isSuccess } = useEntireClass(); + + const handleEntireClassDataList = useCallback(() => { + if (data) { + const entireClassData = data.data.data; + // FIXME: 수정 + setClassListData(entireClassData); + } + }, [data]); + + useEffect(() => { + if (isSuccess) { + handleEntireClassDataList(); + } + }, [handleEntireClassDataList, isSuccess]); + + return ( +
+
+
+
전체 클래스
+
한번에 보기
+
+
+
+
+ {/* FIXME: 수정 필요 */} + {isLoading ? ( +
+ + + +
+ ) : classListData && isSuccess ? ( + + ) : ( +
클래스가 존재하지 않습니다
+ )} +
+
+
+ ); +}; + +export default EntirePage;