Use of Server Components for easier Data fetching + start use of v2 API
This commit is contained in:
parent
49ceda5575
commit
f23c9dc0f1
6 changed files with 195 additions and 5 deletions
app
12
app/page.tsx
12
app/page.tsx
|
@ -1,12 +1,14 @@
|
|||
'use client';
|
||||
import '@/app/globals.css';
|
||||
import { Game, GameGroup } from '@/types/stellaris';
|
||||
import { GameView } from '@/components/gui/game-view';
|
||||
import { generateUrl } from '@/components/server/fetchers';
|
||||
|
||||
export default async function Home() {
|
||||
const games = await fetch(generateUrl('/games')).then((res) => res.json())
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<main>
|
||||
<div>
|
||||
<p>Empire Overview goes here evenutally</p>
|
||||
</div>
|
||||
<GameView games={games}/>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
|
Reference in a new issue