34 lines
825 B
TypeScript
34 lines
825 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()
|
|
const pubsWithGenres = await getPubsWithGenres()
|
|
|
|
|
|
|
|
return (
|
|
<div className="container mx-auto">
|
|
<DataTable columns={columns} data={storiesWithGenres} type="story">
|
|
<CreateStoryDialog genres={genres} />
|
|
{/* TODO - EDIT STORY DIALOG */}
|
|
</DataTable>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
|
|
|