From 67d61b8cf70a82bf6702ca69b5a9167c9c8a17f7 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 5 Sep 2025 12:15:54 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(frontend)=20decouple=20Pagin?= =?UTF-8?q?ationControl=20from=20usePagination=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace ReturnType prop type with explicit Props interface defining only required fields (currentPage, totalPages, onPageChange) to decouple component from internal hook implementation. Eliminates unnecessary runtime dependency and improves component API clarity by explicitly declaring required props instead of coupling to hook internals, making the component more maintainable and reusable. --- .../components/controls/PaginationControl.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/frontend/src/features/rooms/livekit/components/controls/PaginationControl.tsx b/src/frontend/src/features/rooms/livekit/components/controls/PaginationControl.tsx index 4ed1ff91..4409e209 100644 --- a/src/frontend/src/features/rooms/livekit/components/controls/PaginationControl.tsx +++ b/src/frontend/src/features/rooms/livekit/components/controls/PaginationControl.tsx @@ -1,19 +1,16 @@ import * as React from 'react' import { createInteractingObservable } from '@livekit/components-core' -import { usePagination } from '@livekit/components-react' import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react' import { Button } from '@/primitives' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { css } from '@/styled-system/css' -export interface PaginationControlProps - extends Pick< - ReturnType, - 'totalPageCount' | 'nextPage' | 'prevPage' | 'currentPage' - > { - /** Reference to an HTML element that holds the pages, while interacting (`mouseover`) - * with it, the pagination controls will appear for a while. */ +export interface PaginationControlProps { + totalPageCount: number + nextPage: () => void + prevPage: () => void + currentPage: number pagesContainer?: React.RefObject }