mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
暂存
This commit is contained in:
parent
f91f4085bc
commit
c8b6c31357
@ -2,6 +2,7 @@ import { Flex } from "antd";
|
||||
import prisma from "@/lib/prisma";
|
||||
import { User } from "@prisma/client";
|
||||
import UsersTable from "../../components/users-table";
|
||||
import UserTableSearchInput from "../../components/user-table-search";
|
||||
|
||||
async function getData() {
|
||||
return await prisma.user.findMany({
|
||||
@ -18,6 +19,9 @@ export default async function UsersPage() {
|
||||
return (
|
||||
<>
|
||||
<Flex gap="middle" vertical>
|
||||
<div style={{ width: "360px;", fontSize: 0 }}>
|
||||
<UserTableSearchInput />
|
||||
</div>
|
||||
<UsersTable users={users} />
|
||||
</Flex>
|
||||
</>
|
||||
|
@ -63,12 +63,12 @@ const SideBar: React.FC = () => {
|
||||
setCurrent(e.key);
|
||||
router.push(e.key);
|
||||
};
|
||||
useEffect(() => {
|
||||
// 如果按钮和路径不相等,那其实应该跳转到按钮的网址
|
||||
if (current != pathname) {
|
||||
router.push(current);
|
||||
}
|
||||
}, [current, pathname, router]);
|
||||
// useEffect(() => {
|
||||
// // 如果按钮和路径不相等,那其实应该跳转到按钮的网址
|
||||
// if (current != pathname) {
|
||||
// router.push(current);
|
||||
// }
|
||||
// }, [current, pathname, router]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
31
app/app/(admin)/components/user-table-search.tsx
Normal file
31
app/app/(admin)/components/user-table-search.tsx
Normal file
@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import { AudioOutlined } from "@ant-design/icons";
|
||||
import { Input, Space } from "antd";
|
||||
import type { SearchProps } from "antd/es/input/Search";
|
||||
|
||||
const { Search } = Input;
|
||||
|
||||
const suffix = (
|
||||
<AudioOutlined
|
||||
style={{
|
||||
fontSize: 16,
|
||||
color: "#1677ff",
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
const onSearch: SearchProps["onSearch"] = (value, _e, info) =>
|
||||
console.log(info?.source, value);
|
||||
|
||||
const UserTableSearchInput: React.FC = () => (
|
||||
<Search
|
||||
placeholder="input search text"
|
||||
onSearch={onSearch}
|
||||
enterButton
|
||||
style={{ width: 304 }}
|
||||
/>
|
||||
);
|
||||
|
||||
export default UserTableSearchInput;
|
Loading…
Reference in New Issue
Block a user