import { Story } from "@prisma/client";
import { DataTable } from "app/ui/tables/data-table";
import { columns } from "./columns";
import { getStoriesWithGenres } from "app/lib/get";
import { Genre } from "@prisma/client";

export type StoryWithGenres = Story & { genres: Array<Genre> }

export default async function Page() {
  const stories: Array<StoryWithGenres> = await getStoriesWithGenres()
  return (
    <div className="container mx-auto py-10">
      <DataTable columns={columns} data={stories} />
    </div>
  )
}



