import React, { useMemo } from "react"; import AppLayout from "@/layouts/app-layout"; import { Card, Container, Group, Button, Title, ActionIcon } from "@mantine/core"; import { MantineReactTable } from "mantine-react-table"; import { IconEdit, IconPlus } from "@tabler/icons-react"; import { Link } from "@inertiajs/react"; import { User } from "@/types"; import type { MRT_Row } from "mantine-react-table"; interface Props { users: User[]; } export default function Page({ users }: Props) { const data = users ?? []; const columns = useMemo( () => [ { accessorKey: "name", header: "Name", }, { accessorKey: "email", header: "Email", }, { id: "roles", header: "Roles", accessorFn: (row: User) => row.roles?.map((role) => role.name).join(", ") ?? "—", }, { id: "manager", header: "Reports To", accessorFn: (row: User) => row.manager?.name ?? "—", }, ], [], ); const renderRowActions = ({ row }: { row: MRT_Row }) => ( ); return ( Users ); }