34 lines
782 B
TypeScript
34 lines
782 B
TypeScript
import { Story } from "@prisma/client";
|
|
import { DataTable } from "app/ui/tables/data-table";
|
|
import { columns } from "./columns";
|
|
import { getGenres, getStoriesWithGenres, getPubsWithGenres } from "app/lib/get";
|
|
import { Genre } from "@prisma/client";
|
|
import CreateStoryDialog from "./create";
|
|
|
|
export type StoryWithGenres = Story & { genres: Array<Genre> }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default async function Page() {
|
|
const genres = await getGenres()
|
|
const storiesWithGenres: Array<StoryWithGenres> = await getStoriesWithGenres()
|
|
|
|
|
|
|
|
return (
|
|
<div className="container px-1 md:px-4 mx-auto">
|
|
<DataTable columns={columns} data={storiesWithGenres} tableName="story"
|
|
genres={genres}
|
|
>
|
|
<CreateStoryDialog genres={genres} />
|
|
</DataTable>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
|
|
|