You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
701 B
TypeScript

import { BookmarkCard } from '@/components/bookmarkCard'
import { bookmarkSchema } from '@/types'
import { bookmark } from '@/lib/schema'
import { db } from '@/lib/db'
import EditBookmarkForm from '@/components/editBookmarkForm'
export const dynamic = 'force-dynamic'
export const fetchCache = 'force-no-store'
export default async function DashboardPage() {
const data = await db.select().from(bookmark)
const bookmarks = bookmarkSchema.array().parse(data)
return (
<div className='mt-4 flex w-full max-w-4xl flex-row flex-wrap justify-center gap-6'>
{bookmarks.map((data, index) => (
<BookmarkCard
key={index}
data={data}
/>
))}
<EditBookmarkForm />
</div>
)
}