'use client'
interface PaginationProps { page: number; totalPages: number; onPageChange: (page: number) => void }
export function Pagination({ page, totalPages, onPageChange }: PaginationProps) {
  if (totalPages <= 1) return null
  return (
    <div className="flex items-center justify-between text-sm text-slate-600 dark:text-slate-400">
      <span>第 {page} / {totalPages} 页</span>
      <div className="flex gap-1">
        <button onClick={() => onPageChange(page - 1)} disabled={page <= 1} className="px-3 py-1 rounded border border-slate-200 dark:border-slate-700 disabled:opacity-50">上一页</button>
        <button onClick={() => onPageChange(page + 1)} disabled={page >= totalPages} className="px-3 py-1 rounded border border-slate-200 dark:border-slate-700 disabled:opacity-50">下一页</button>
      </div>
    </div>
  )
}
