"use client"; import { User2 } from "lucide-react"; import { PaginatedTable } from "../../../_components/PaginatedTable"; import Link from "next/link"; import { ColumnDef } from "@tanstack/react-table"; import { DiscordAccount, User } from "@repo/db"; import { useSession } from "next-auth/react"; const AdminUserPage = () => { const { data: session } = useSession(); return ( <> Keine; } else if (props.row.original.permissions.includes("ADMIN_USER_ADVANCED")) { return Admin; } return ( {props.row.original.permissions .filter((p) => p === "PILOT" || p === "DISPO") .join(", ")} ); }, }, { header: "Discord", cell(props) { const discord = props.row.original.discordAccounts; if (discord.length === 0) { return Nicht verbunden; } return {discord.map((d) => d.username).join(", ")}; }, }, ...(session?.user.permissions.includes("ADMIN_USER_ADVANCED") ? [ { header: "Email", accessorKey: "email", }, ] : []), { header: "Aktionen", cell: ({ row }) => (
), }, ] as ColumnDef[] } // Define the columns for the user table leftOfSearch={

Benutzer

} /> ); }; AdminUserPage.displayName = "AdminUserPage"; export default AdminUserPage;