import { Button } from "@/components/ui/button";
import { ChevronLeft, ChevronRight } from "lucide-react";

export default function PaginationBar({ offset, limit, hasMore, onPrev, onNext }: {
  offset: number;
  limit: number;
  hasMore: boolean;
  onPrev: () => void;
  onNext: () => void;
}) {
  const page = Math.floor(offset / limit) + 1;
  return (
    <div className="flex items-center justify-center gap-3 px-4 py-3 border-t border-border">
      <Button className="h-7 px-2 text-[11px]" disabled={offset === 0} onClick={onPrev} variant="ghost">
        <ChevronLeft className="size-3 mr-1" /> Prev
      </Button>
      <span className="font-mono text-[11px] text-muted-foreground">Page {page}</span>
      <Button className="h-7 px-2 text-[11px]" disabled={!hasMore} onClick={onNext} variant="ghost">
        Next <ChevronRight className="size-3 ml-1" />
      </Button>
    </div>
  );
}