"use server";
import { db } from "~/server/db";
import Wine from "./Wine";

export default async function WineList() {
  const wines = await db.query.wines.findMany();
  return (
    <>
      <h1>All wines:</h1>
      <ul>
        {wines.map((wine) => (
          <Wine wine={wine} />
        ))}
      </ul>
    </>
  );
}
