- {liveList &&
- liveList.map(livePreviewInfo => {
- const { broadcastId, broadcastTitle, camperId, profileImage, thumbnail } = livePreviewInfo;
- return (
-
-
-
- );
- })}
+
+
+
+
+
+
+ {liveList ? (
+ liveList.map(data => {
+ const { broadcastId, broadcastTitle, camperId, profileImage, thumbnail } = data;
+ console.log(data);
+ return (
+
+
+
+ );
+ })
+ ) : (
+
방송 정보가 없습니다.
+ )}
+
);
}
diff --git a/apps/client/src/pages/Home/Search.tsx b/apps/client/src/pages/Home/Search.tsx
new file mode 100644
index 00000000..852be20e
--- /dev/null
+++ b/apps/client/src/pages/Home/Search.tsx
@@ -0,0 +1,5 @@
+function Search() {
+ return
;
+}
+
+export default Search;
diff --git a/apps/client/src/pages/Home/index.tsx b/apps/client/src/pages/Home/index.tsx
index 3e138532..8bd89c4e 100644
--- a/apps/client/src/pages/Home/index.tsx
+++ b/apps/client/src/pages/Home/index.tsx
@@ -1,37 +1,9 @@
import LiveList from '@pages/Home/LiveList';
-import LoadingCharacter from '@components/LoadingCharacter';
-import ErrorCharacter from '@components/ErrorCharacter';
-import { useAPI } from '@hooks/useAPI';
-import { LivePreviewListInfo } from '@/types/homeTypes';
-import { useEffect, useState } from 'react';
export default function Home() {
- const { data: liveListInfo, isLoading, error } = useAPI
({ url: '/v1/broadcasts' });
- const [showLoading, setShowLoading] = useState(false);
-
- useEffect(() => {
- const timer = setTimeout(() => {
- setShowLoading(true);
- }, 250);
-
- return () => clearTimeout(timer);
- });
-
return (
- {error ? (
-
-
-
- ) : isLoading && showLoading ? (
-
-
-
- ) : liveListInfo?.broadcasts && liveListInfo.broadcasts.length > 0 ? (
-
- ) : (
-
방송 중인 캠퍼가 없습니다.
- )}
+
);
}
diff --git a/apps/client/src/types/liveTypes.ts b/apps/client/src/types/liveTypes.ts
index 8352e369..4ae44e92 100644
--- a/apps/client/src/types/liveTypes.ts
+++ b/apps/client/src/types/liveTypes.ts
@@ -9,7 +9,9 @@ export interface LiveInfo {
title: string;
camperId: string;
viewers: number;
- field: 'WEB' | 'AND' | 'IOS';
+ field: Field;
profileImage: string;
contacts: ContactInfo;
}
+
+export type Field = 'WEB' | 'AND' | 'IOS' | '';