mirror of
https://github.com/makeplane/plane.git
synced 2026-07-12 21:40:18 +02:00
* chore: integrated time traking enabled/disabled feature on project settings and updated the pro icon as a component * chore: Showing the toggle and disabled to make any operations on project features * chore: default exports in constants * chore: seperated isEnabled and isPro * chore: updated time traking key * chore: issue worklog endpoint * chore: added work log issue * chore: csv worklog downloads * chore: acitvity listing * chore: added workspace in export issues * chore: initialised services, contants, and store * chore: integrated worklog hooks * chore: changed types in worklog type * chore: worklog response changes * chore: serializer changes * chore: corrected the import statement * chore: Worklog components and page updates * fix: download csv and excel * chore: implemented pagination for table and updated worklog downloads * chore: updated pagination and updated the api for worklog download filter param * chore: download response change * chore: import errors resolved in issue worklog * chore: handled loaders and empty states in worklog settings * chore: ui, typos and cleanup * chore: resolved merge conflicts * chore: updating the time tracking on issue detail page * chore: updated the ui worklog issue property button * chore: removed create from the worklog header * chore: updated default filters from constants * chore: resolved ce code updates * chore: ce cleanup * chore: worklogs in issue activity * ui: updated UI for peek overview and issue detail for worklog property * fix: exporter type * ui: handled the typos * ui: loader ui height changes * chore: resolved merge conflicts * chore: handled the project worklogs enabled/disabled in the issues * chore: handled empty screen for worklog * chore: typo --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
"use client";
|
|
|
|
import { FC } from "react";
|
|
import { Button } from "@plane/ui";
|
|
// plane web types
|
|
import { TDefaultPaginatedInfo } from "@/plane-web/types";
|
|
|
|
type TPaginationBar = {
|
|
perPage: number;
|
|
paginationInfo: TDefaultPaginatedInfo;
|
|
onPrevClick: () => void;
|
|
onNextClick: () => void;
|
|
};
|
|
|
|
export const PaginationBar: FC<TPaginationBar> = (props) => {
|
|
const { perPage, paginationInfo, onPrevClick, onNextClick } = props;
|
|
|
|
// derived values
|
|
const totalCount = paginationInfo?.total_count || 0;
|
|
const currentPage = Number(paginationInfo?.next_cursor?.split(":")[1] || 0);
|
|
const staatPageCount = currentPage === 1 ? currentPage : currentPage * perPage - perPage + 1;
|
|
const endPageCount = staatPageCount + perPage - 1;
|
|
const finalStartCount = staatPageCount;
|
|
const finalEndCount = endPageCount > totalCount ? totalCount : endPageCount;
|
|
const renderCurrentPageStatus = `${finalStartCount}-${finalEndCount} of ${totalCount}`;
|
|
|
|
return (
|
|
<div className="w-full flex justify-between items-center gap-2">
|
|
<div className="text-sm font-medium text-custom-text-300 whitespace-nowrap">{renderCurrentPageStatus}</div>
|
|
<div className="flex items-center gap-2">
|
|
<Button size="sm" variant="neutral-primary" onClick={onPrevClick} disabled={!paginationInfo?.prev_page_results}>
|
|
Prev
|
|
</Button>
|
|
<Button size="sm" variant="neutral-primary" onClick={onNextClick} disabled={!paginationInfo?.next_page_results}>
|
|
Next
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|