24
src/app/(root)/user/page.tsx
Normal file
24
src/app/(root)/user/page.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client"
|
||||
import { getPageUsers } from "@/actions/user"
|
||||
import { DataTable, useDataTable } from "@/components/data-table"
|
||||
import type { User } from "@/models/user"
|
||||
|
||||
export default function UserPage() {
|
||||
const table = useDataTable<User>((page, size) => getPageUsers({ page, size }))
|
||||
return (
|
||||
<div>
|
||||
<DataTable<User>
|
||||
{...table}
|
||||
columns={[
|
||||
{ header: "ID", accessorKey: "id" },
|
||||
{ header: "姓名", accessorKey: "name" },
|
||||
{ header: "邮箱", accessorKey: "email" },
|
||||
{ header: "角色", accessorKey: "role" },
|
||||
{ header: "状态", accessorKey: "status" },
|
||||
{ header: "创建时间", accessorKey: "createdAt" },
|
||||
{ header: "更新时间", accessorKey: "updatedAt" },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user