mirror of
https://github.com/ershisan99/www.git
synced 2026-01-25 21:02:08 +00:00
initialize project
This commit is contained in:
18
src/app/page.tsx
Normal file
18
src/app/page.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { UserStats } from '@/app/_components/user-stats'
|
||||
import { auth } from '@/server/auth'
|
||||
import { HydrateClient, api } from '@/trpc/server'
|
||||
|
||||
export default async function Home() {
|
||||
const hello = await api.post.hello({ text: 'from tRPC' })
|
||||
const session = await auth()
|
||||
|
||||
if (session?.user) {
|
||||
void api.post.getLatest.prefetch()
|
||||
}
|
||||
|
||||
return (
|
||||
<HydrateClient>
|
||||
<UserStats />
|
||||
</HydrateClient>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user