27 lines
747 B
TypeScript
27 lines
747 B
TypeScript
'use client'
|
|
|
|
import { useEffect, useState } from 'react'
|
|
import { CardGroup } from '@/components/ui/card-group'
|
|
|
|
export default function Home() {
|
|
const [commanderCardList, setCommanderCardList] = useState([])
|
|
|
|
useEffect(() => {
|
|
fetch('/api/json/commander/top.json').then((res) => {
|
|
if(res.status == 200) {
|
|
res.json().then((data) => {
|
|
const limit = 20
|
|
setCommanderCardList(data.slice(0,limit))
|
|
console.log(data)
|
|
})
|
|
}
|
|
})
|
|
}, [])
|
|
return (
|
|
<div className="flex flex-col items-center w-full">
|
|
<div className="flex flex-col items-center mt-24 mb-24 max-w-6xl">
|
|
<CardGroup groupName="Top commandants" cards={commanderCardList} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|