-
Notifications
You must be signed in to change notification settings - Fork 23
implemented sliding-window-pagination table #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,19 +23,11 @@ import { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TableHeader, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } from "@/components/ui/table"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pagination, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PaginationNext, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PaginationLink, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PaginationContent, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PaginationPrevious, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PaginationEllipsis, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } from "@/components/ui/pagination"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { streamColumns } from "./streamColumns"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { StreamRecord } from "@/lib/validations"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { validPageLimits } from "@/lib/constants"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import AppSelect from "@/components/molecules/AppSelect"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import SlidingPagination from "@/components/molecules/SlidingPagination"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| interface StreamsTableProps { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data: StreamRecord[]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -86,9 +78,6 @@ function StreamsTable({ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| router.push(`?${params.toString()}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const canPreviousPage = page > 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const canNextPage = page < pageCount; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const pageSize = validPageLimits.map((limit) => ({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label: `${limit} per page`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| value: limit.toString(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -204,8 +193,8 @@ function StreamsTable({ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {/* Pagination */} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {totalCount > 0 && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Pagination> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PaginationContent className="hidden lg:flex items-center space-x-4"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="hidden lg:flex items-center space-x-4"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p className="text-sm font-medium text-zinc-300">Showing</p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <AppSelect | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| options={pageSize} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -217,50 +206,21 @@ function StreamsTable({ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setValue={handlePageSizeChange} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| title="Rows per page" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </PaginationContent> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PaginationContent className="hidden lg:flex flex-col sm:flex-row sm:space-y-0 sm:space-x-6 lg:space-x-8"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className="flex w-[100px] items-center justify-center text-sm font-medium text-zinc-300" aria-live="polite" aria-atomic="true"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Page {page} of {pageCount} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </PaginationContent> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PaginationContent className="gap-2"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PaginationPrevious | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => updatePage(page - 1)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disabled={!canPreviousPage} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {Array.from( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { length: pageCount > 3 ? 3 : pageCount }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (_, index) => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PaginationLink | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key={`streams-pagination-${index}`} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => updatePage(index + 1)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isActive={page === index + 1} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {index + 1} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </PaginationLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {pageCount > 3 ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PaginationContent className="flex items-center space-x-4"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PaginationEllipsis /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PaginationLink | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => updatePage(pageCount)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isActive={page === pageCount} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {pageCount} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </PaginationLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </PaginationContent> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : null} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PaginationNext | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onClick={() => updatePage(page + 1)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disabled={!canNextPage} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </PaginationContent> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Pagination> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
211
to
+215
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Broken JSX structure in pagination summary block. Line 211 opens 💡 Suggested fix- <PaginationContent className="hidden lg:flex flex-col sm:flex-row sm:space-y-0 sm:space-x-6 lg:space-x-8">
+ <div className="hidden lg:flex flex-col sm:flex-row sm:space-y-0 sm:space-x-6 lg:space-x-8">
<div className="flex w-[100px] items-center justify-center text-sm font-medium text-zinc-300" aria-live="polite" aria-atomic="true">
Page {page} of {pageCount}
</div>
- </div>
+ </div>📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (2.4.9)[error] 211-211: Expected corresponding JSX closing tag for 'PaginationContent'. (parse) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <SlidingPagination | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| page={page} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pageCount={pageCount} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onPageChange={updatePage} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="mx-0 w-auto justify-end" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| "use client"; | ||
|
|
||
| import { | ||
| Pagination, | ||
| PaginationContent, | ||
| PaginationEllipsis, | ||
| PaginationItem, | ||
| PaginationLink, | ||
| PaginationNext, | ||
| PaginationPrevious, | ||
| } from "@/components/ui/pagination"; | ||
| import { usePagination } from "@/hooks/use-pagination"; | ||
|
|
||
| type SlidingPaginationProps = { | ||
| page: number; | ||
| pageCount: number; | ||
| onPageChange: (p: number) => void; | ||
| className?: string; | ||
| }; | ||
|
|
||
| const clampPage = (value: number, min: number, max: number) => | ||
| Math.min(Math.max(value, min), max); | ||
|
|
||
| const SlidingPagination = ({ | ||
| page, | ||
| pageCount, | ||
| onPageChange, | ||
| className, | ||
| }: SlidingPaginationProps) => { | ||
| const safePageCount = Math.max(1, pageCount); | ||
| const currentPage = clampPage(page, 1, safePageCount); | ||
| const items = usePagination({ | ||
| currentPage, | ||
| pageCount: safePageCount, | ||
| siblingCount: 2, | ||
| }); | ||
|
|
||
| const navigate = (targetPage: number) => { | ||
| const nextPage = clampPage(targetPage, 1, safePageCount); | ||
| if (nextPage !== currentPage) { | ||
| onPageChange(nextPage); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <Pagination className={className}> | ||
| <PaginationContent> | ||
| <PaginationItem> | ||
| <PaginationLink | ||
| href="#" | ||
| size="default" | ||
| disabled={currentPage === 1} | ||
| onClick={(e) => { | ||
| e.preventDefault(); | ||
| navigate(1); | ||
| }} | ||
| > | ||
| First | ||
| </PaginationLink> | ||
| </PaginationItem> | ||
|
|
||
| <PaginationItem> | ||
| <PaginationPrevious | ||
| href="#" | ||
| disabled={currentPage === 1} | ||
| onClick={(e) => { | ||
| e.preventDefault(); | ||
| navigate(currentPage - 1); | ||
| }} | ||
| /> | ||
| </PaginationItem> | ||
|
|
||
| {items.map((item) => ( | ||
| <PaginationItem | ||
| key={item.type === "ellipsis" ? item.key : `page-${item.page}`} | ||
| > | ||
| {item.type === "ellipsis" ? ( | ||
| <PaginationEllipsis /> | ||
| ) : ( | ||
| <PaginationLink | ||
| href="#" | ||
| isActive={item.page === currentPage} | ||
| onClick={(e) => { | ||
| e.preventDefault(); | ||
| navigate(item.page); | ||
| }} | ||
| > | ||
| {item.page} | ||
| </PaginationLink> | ||
| )} | ||
| </PaginationItem> | ||
| ))} | ||
|
|
||
| <PaginationItem> | ||
| <PaginationNext | ||
| href="#" | ||
| disabled={currentPage === safePageCount} | ||
| onClick={(e) => { | ||
| e.preventDefault(); | ||
| navigate(currentPage + 1); | ||
| }} | ||
| /> | ||
| </PaginationItem> | ||
|
|
||
| <PaginationItem> | ||
| <PaginationLink | ||
| href="#" | ||
| size="default" | ||
| disabled={currentPage === safePageCount} | ||
| onClick={(e) => { | ||
| e.preventDefault(); | ||
| navigate(safePageCount); | ||
| }} | ||
| > | ||
| Last | ||
| </PaginationLink> | ||
| </PaginationItem> | ||
| </PaginationContent> | ||
| </Pagination> | ||
| ); | ||
| }; | ||
|
|
||
| export default SlidingPagination; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import { useMemo } from "react"; | ||
|
|
||
| export type PaginationRangeItem = | ||
| | { type: "page"; page: number } | ||
| | { type: "ellipsis"; key: "left" | "right" }; | ||
|
|
||
| type UsePaginationParams = { | ||
| currentPage: number; | ||
| pageCount: number; | ||
| siblingCount?: number; | ||
| }; | ||
|
|
||
| const range = (start: number, end: number) => | ||
| Array.from({ length: end - start + 1 }, (_, index) => start + index); | ||
|
|
||
| export const getPaginationRange = ({ | ||
| currentPage, | ||
| pageCount, | ||
| siblingCount = 2, | ||
| }: UsePaginationParams): PaginationRangeItem[] => { | ||
| const safePageCount = Math.max(1, pageCount); | ||
| const safeCurrentPage = Math.min(Math.max(1, currentPage), safePageCount); | ||
| const windowSize = siblingCount * 2 + 1; | ||
|
|
||
| if (safePageCount <= 7) { | ||
| return range(1, safePageCount).map((page) => ({ type: "page", page })); | ||
| } | ||
|
|
||
| let left = Math.max(2, safeCurrentPage - siblingCount); | ||
| let right = Math.min(safePageCount - 1, safeCurrentPage + siblingCount); | ||
|
|
||
| while (right - left + 1 < windowSize) { | ||
| if (left > 2) { | ||
| left -= 1; | ||
| continue; | ||
| } | ||
|
|
||
| if (right < safePageCount - 1) { | ||
| right += 1; | ||
| continue; | ||
| } | ||
|
|
||
| break; | ||
| } | ||
|
|
||
| const showLeftEllipsis = left > 2; | ||
| const showRightEllipsis = right < safePageCount - 1; | ||
|
|
||
| const items: PaginationRangeItem[] = [{ type: "page", page: 1 }]; | ||
|
|
||
| if (showLeftEllipsis) { | ||
| items.push({ type: "ellipsis", key: "left" }); | ||
| } | ||
|
|
||
| range(left, right).forEach((page) => { | ||
| items.push({ type: "page", page }); | ||
| }); | ||
|
|
||
| if (showRightEllipsis) { | ||
| items.push({ type: "ellipsis", key: "right" }); | ||
| } | ||
|
|
||
| items.push({ type: "page", page: safePageCount }); | ||
|
|
||
| return items; | ||
| }; | ||
|
|
||
| export const usePagination = (params: UsePaginationParams) => | ||
| useMemo(() => getPaginationRange(params), [params]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undefined handler causes a compile-time failure.
Line 252 and Line 254 call
updateHistoryParams, but that symbol is not defined/imported in this file. This blocks the build.💡 Minimal fix
🤖 Prompt for AI Agents