Redesigned Search, removed Unused Admin Route
This commit is contained in:
@@ -3,14 +3,22 @@ import { DatabaseBackupIcon } from "lucide-react";
|
||||
import { PaginatedTable } from "../../../_components/PaginatedTable";
|
||||
import Link from "next/link";
|
||||
import { ColumnDef } from "@tanstack/react-table";
|
||||
import { Station } from "@repo/db";
|
||||
import { Prisma, Station } from "@repo/db";
|
||||
|
||||
const page = () => {
|
||||
return (
|
||||
<>
|
||||
<PaginatedTable
|
||||
prismaModel="station"
|
||||
searchFields={["bosCallsign", "operator"]}
|
||||
showSearch
|
||||
getFilter={(searchField) =>
|
||||
({
|
||||
OR: [
|
||||
{ bosCallsign: { contains: searchField, mode: "insensitive" } },
|
||||
{ operator: { contains: searchField, mode: "insensitive" } },
|
||||
],
|
||||
}) as Prisma.StationWhereInput
|
||||
}
|
||||
stickyHeaders
|
||||
columns={
|
||||
[
|
||||
@@ -44,11 +52,11 @@ const page = () => {
|
||||
}
|
||||
leftOfSearch={
|
||||
<span className="flex items-center gap-2">
|
||||
<DatabaseBackupIcon className="w-5 h-5" /> Stationen
|
||||
<DatabaseBackupIcon className="h-5 w-5" /> Stationen
|
||||
</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/station/new"}>
|
||||
<button className="btn btn-sm btn-outline btn-primary">Erstellen</button>
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user