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

export const dynamic = 'force-dynamic'
export const revalidate = 1

export type StoryWithGenres = Story & { genres: Array<Genre> }
const stories: Array<StoryWithGenres> = await getStoriesWithGenres()

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



