Redesigned Search, removed Unused Admin Route
This commit is contained in:
@@ -3,7 +3,7 @@ import { DatabaseBackupIcon } from "lucide-react";
|
||||
import { PaginatedTable } from "../../../_components/PaginatedTable";
|
||||
import Link from "next/link";
|
||||
import { ColumnDef } from "@tanstack/react-table";
|
||||
import { Keyword } from "@repo/db";
|
||||
import { Keyword, Prisma } from "@repo/db";
|
||||
|
||||
export default () => {
|
||||
return (
|
||||
@@ -12,7 +12,16 @@ export default () => {
|
||||
stickyHeaders
|
||||
initialOrderBy={[{ id: "category", desc: true }]}
|
||||
prismaModel="keyword"
|
||||
searchFields={["name", "abreviation", "description"]}
|
||||
showSearch
|
||||
getFilter={(searchTerm) =>
|
||||
({
|
||||
OR: [
|
||||
{ name: { contains: searchTerm, mode: "insensitive" } },
|
||||
{ abreviation: { contains: searchTerm, mode: "insensitive" } },
|
||||
{ category: { contains: searchTerm, mode: "insensitive" } },
|
||||
],
|
||||
}) as Prisma.KeywordWhereInput
|
||||
}
|
||||
columns={
|
||||
[
|
||||
{
|
||||
@@ -41,11 +50,11 @@ export default () => {
|
||||
}
|
||||
leftOfSearch={
|
||||
<span className="flex items-center gap-2">
|
||||
<DatabaseBackupIcon className="w-5 h-5" /> Stichwörter
|
||||
<DatabaseBackupIcon className="h-5 w-5" /> Stichwörter
|
||||
</span>
|
||||
}
|
||||
rightOfSearch={
|
||||
<p className="text-2xl font-semibold text-left flex items-center gap-2 justify-between">
|
||||
<p className="flex items-center justify-between gap-2 text-left text-2xl font-semibold">
|
||||
<Link href={"/admin/keyword/new"}>
|
||||
<button className="btn btn-sm btn-outline btn-primary">Erstellen</button>
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user