'use client';
import { ChevronLeft, ChevronRight } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
import { useI18n } from '@/lib/hooks/use-i18n';
import { cn } from '@/lib/utils/cn';
export interface CanvasPagerProps {
readonly index: number;
readonly count: number;
readonly canPrev: boolean;
readonly canNext: boolean;
readonly onPrev: () => void;
readonly onNext: () => void;
}
/**
* Where the pager is mounted.
*
* `dock` is the normal form: paging is a global control of the whole deck, so it
* lives in the edit dock's global edit bar alongside the other course-level
* entries rather than floating over the page it is about to leave.
*
* `floating` is the fallback for scene types that get no dock at all (no
* narration timeline ⇒ no bench to hang tools off — see
* `components/edit/scene-timeline.ts`). Without it those scenes would lose
* paging entirely.
*/
export type CanvasPagerVariant = 'dock' | 'floating';
/** Scene navigation — in the dock's global edit bar, or floating when there is no dock. */
export function CanvasPager({
index,
count,
canPrev,
canNext,
onPrev,
onNext,
variant = 'floating',
}: CanvasPagerProps & { readonly variant?: CanvasPagerVariant }) {
const { t } = useI18n();
if (count <= 0) return null;
const controls = (
<>