"Next, import the auto-generated getXataClient function from src/xata.ts, get all the posts using the client, and list them within the page:
src/app/page.tsx
import { getXataClient } from '@/xata';
const xata = getXataClient();
export default async function Home() {
const posts = await xata.db.Posts.getAll();
return (
<>
<div className="w-full max-w-5xl mt-16">
{posts.length === 0 && <p>No blog posts found</p>}
{posts.map((post) => ("
"Next, import the auto-generated getXataClient function from src/xata.ts, get all the posts using the client, and list them within the page:
src/app/page.tsx
import { getXataClient } from '@/xata';
const xata = getXataClient();
export default async function Home() {
const posts = await xata.db.Posts.getAll();
return (
<>
<div className="w-full max-w-5xl mt-16">
{posts.length === 0 && <p>No blog posts found</p>}
{posts.map((post) => ("