diff --git a/pages/index.tsx b/pages/index.tsx index 378acfd..2a7343e 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,8 +1,13 @@ -import { NextPage } from 'next' +import { NextPage, NextPageContext } from 'next' +import Advertisement from '../components/Advertisement' +import BotCard from '../components/BotCard' import Container from '../components/Container' +import LongButton from '../components/LongButton' import Wave from '../components/Wave' +import { BotList } from '../types' +import { Fetch } from '../utils' -const Index: NextPage = () => { +const Index: NextPage = ({ votes, newBots, trusted }) => { return ( <>
@@ -18,21 +23,56 @@ const Index: NextPage = () => { /> +

하트 랭킹

하트를 많이 받은 봇들의 순위입니다!

-

- 새로운 봇 +
+ { + votes.data.slice(0, 8).map(bot=> ) + } +
+ +

더보기

+
+

+ 새로운 봇

최근에 한국 디스코드봇 리스트에 추가된 따끈따끈한 봇입니다.

+
+ { + newBots.data.slice(0, 4).map(bot=> ) + } +

신뢰된 봇

KOREANBOTS에서 인증받은 신뢰할 수 있는 봇들입니다!!

+
+ { + trusted.data.slice(0, 4).map(bot=> ) + } +
+ ) } +export const getServerSideProps = async() => { + const votes = await Fetch.botListVotes.load(1) + const newBots = await Fetch.botListNew.load(1) + const trusted = await Fetch.botListTrusted.load(1) + + return { props: { votes, newBots, trusted }} + +} + +interface IndexProps { + votes: BotList + newBots: BotList + trusted: BotList +} + export default Index