"use client"; import type { ReactNode } from "react"; import { cx } from "../../utils"; import { FoxCaretLeftIcon, FoxCaretRightIcon } from "../../icons"; export interface FoxPaginationProps { /** 1부터 센다. */ currentPage: number; totalPages: number; onPageChange?: (page: number) => void; /** * 페이지 번호를 링크로 만들 때. 주면 ``가 되고, 없으면 ` ); }; const number = (page: number) => { const current = page === currentPage; const itemClass = cx( "fox-pagination__item", "fox-pagination__number", current && "fox-pagination__number--current" ); if (current) { return ( {page} ); } return buildHref ? ( onPageChange?.(page)} > {page} ) : ( ); }; const more = ( ); // 이전·목록·다음이 형제다. 모바일에서 목록만 한 줄을 통째로 차지해 아래로 밀린다. return ( ); }