Skip to content

Commit

Permalink
fix(dash): fix dash area
Browse files Browse the repository at this point in the history
  • Loading branch information
AprilNEA committed May 13, 2023
1 parent cdf4d7d commit 1570a33
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions apps/dash/src/app/[area]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import useSWR from "swr";
import fetcher from "@/utils/fetcher";

import {
Button,
Card,
Grid,
Input,
Expand All @@ -30,10 +31,11 @@ export default function Page({
}) {
const [currentPage, setCurrentPage] = useState<number>(1);
const [cursor, setCursor] = useState<number>(0);
const [count, setCount] = useState<number>(10);
const [count, setCount] = useState<number>(100);
const [key, setKey] = useState<string>("");

const { data, isLoading } = useSWR(
`/api/${params.area}?cursor=${cursor}&&count=${count}` as string,
`/api/${params.area}?cursor=${cursor}&count=${count}&key=${key}` as string,
(url) => fetcher(url).then((res) => res.json())
);

Expand Down Expand Up @@ -63,7 +65,11 @@ export default function Page({
setCurrentPage(0);
setCount(Math.abs(gap) * 10);
}
setCount();
// setCount();
};

const handleSearch = () => {
setKey(searchUser);
};

if (isLoading) return <Loading />;
Expand All @@ -82,15 +88,20 @@ export default function Page({
<Select.Option value="2">Pro</Select.Option>
<Select.Option value="3">Premium</Select.Option>
</Select>
<Spacer w={5} />

<Button loading={isLoading} onClick={handleSearch}>
搜索
</Button>
</div>
</Card>
</Grid>
<Grid xs={24}>
<Table tableColumn={columns} tableData={data?.data?.data} />
</Grid>
<Grid xs={12}>
<Pagination page={currentPage} initialPage={1} onChange={pageChange} />
</Grid>
{/*<Grid xs={12}>*/}
{/* <Pagination page={currentPage} initialPage={1} onChange={pageChange} />*/}
{/*</Grid>*/}
</Grid.Container>
);
}

2 comments on commit 1570a33

@vercel
Copy link

@vercel vercel bot commented on 1570a33 May 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lmo-dash-demo – ./apps/dash

chat-gpt-admin-web.vercel.app
lmo-dash-demo-lmobest.vercel.app
lmo-dash-demo-git-main-lmobest.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 1570a33 May 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

chat-gpt-admin-web – ./apps/chat

chat-gpt-admin-web-git-main-lmobest.vercel.app
chat-gpt-admin-web-umber-nine.vercel.app
chat-gpt-admin-web-lmobest.vercel.app

Please sign in to comment.