Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
@import '@libs/ui/styles/includes';

.shortPage {
margin-bottom: 250px;
}

.tableWrapper {
margin-bottom: 60px;
}

.actionButtons {
display: flex;
gap: $sp-1;
Expand Down
5 changes: 4 additions & 1 deletion src/apps/copilots/src/pages/copilot-requests/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ const CopilotRequestsPage: FC = () => {
isValidating: requestsLoading,
hasMoreCopilotRequests,
setSize,
size }: CopilotRequestsResponse = useCopilotRequests(sort)
size,
page,
}: CopilotRequestsResponse = useCopilotRequests(sort)

const viewRequestDetails = useMemo(() => (
routeParams.requestId && find(requests, { id: +routeParams.requestId }) as CopilotRequest
Expand Down Expand Up @@ -265,6 +267,7 @@ const CopilotRequestsPage: FC = () => {
>
<PageTitle>Copilot Requests</PageTitle>
<Table
className={(page === 1 && tableData.length < 10) ? styles.shortPage : styles.tableWrapper}
columns={tableColumns}
data={tableData}
moreToLoad={hasMoreCopilotRequests}
Expand Down
10 changes: 9 additions & 1 deletion src/apps/copilots/src/services/copilot-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type CopilotRequestsResponse = {
isValidating: boolean;
size: number;
setSize: (size: number) => void;
page: number;
}

/**
Expand Down Expand Up @@ -77,7 +78,14 @@ export const useCopilotRequests = (sort: Sort, projectId?: string): CopilotReque
const copilotRequests = data.flatMap(page => page.data)
const hasMoreCopilotRequests = latestPage.page + 1 < latestPage.totalPages

return { data: copilotRequests, hasMoreCopilotRequests, isValidating, setSize: (s: number) => { setSize(s) }, size }
return {
data: copilotRequests,
hasMoreCopilotRequests,
isValidating,
page: latestPage.page,
setSize: (s: number) => { setSize(s) },
size,
}
}

export type CopilotRequestResponse = SWRResponse<CopilotRequest, CopilotRequest>
Expand Down