Changelog-Seite, option zum verstecken von Einträgen auf dieser
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
"use client";
|
||||
import { DatabaseBackupIcon } from "lucide-react";
|
||||
import { Check, Cross, DatabaseBackupIcon } from "lucide-react";
|
||||
import { PaginatedTable } from "../../../_components/PaginatedTable";
|
||||
import Link from "next/link";
|
||||
import { ColumnDef } from "@tanstack/react-table";
|
||||
import { Keyword, Prisma } from "@repo/db";
|
||||
import { Changelog, Keyword, Prisma } from "@repo/db";
|
||||
|
||||
export default () => {
|
||||
return (
|
||||
<>
|
||||
<PaginatedTable
|
||||
stickyHeaders
|
||||
initialOrderBy={[{ id: "title", desc: true }]}
|
||||
initialOrderBy={[{ id: "createdAt", desc: true }]}
|
||||
prismaModel="changelog"
|
||||
showSearch
|
||||
getFilter={(search) =>
|
||||
({
|
||||
OR: [
|
||||
{ title: { contains: search, mode: "insensitive" } },
|
||||
{ description: { contains: search, mode: "insensitive" } },
|
||||
{ text: { contains: search, mode: "insensitive" } },
|
||||
],
|
||||
}) as Prisma.ChangelogWhereInput
|
||||
}
|
||||
@@ -27,6 +27,16 @@ export default () => {
|
||||
header: "Title",
|
||||
accessorKey: "title",
|
||||
},
|
||||
{
|
||||
header: "Auf Changelog Seite anzeigen",
|
||||
accessorKey: "showOnChangelogPage",
|
||||
cell: ({ row }) => (row.original.showOnChangelogPage ? <Check /> : <Cross />),
|
||||
},
|
||||
{
|
||||
header: "Erstellt am",
|
||||
accessorKey: "createdAt",
|
||||
cell: ({ row }) => new Date(row.original.createdAt).toLocaleDateString(),
|
||||
},
|
||||
{
|
||||
header: "Aktionen",
|
||||
cell: ({ row }) => (
|
||||
@@ -37,7 +47,7 @@ export default () => {
|
||||
</div>
|
||||
),
|
||||
},
|
||||
] as ColumnDef<Keyword>[]
|
||||
] as ColumnDef<Changelog>[]
|
||||
}
|
||||
leftOfSearch={
|
||||
<span className="flex items-center gap-2">
|
||||
|
||||
Reference in New Issue
Block a user