"use client"; import { RefreshCw, Share, Info, Loader2 } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; import { Button } from "@/components/ui/button"; interface PageData { id: number; title: string; image: string; prompt: string; characterUploads?: string[]; style: string; dbId?: string; } interface ComicCanvasProps { page: PageData; pageIndex: number; isLoading?: boolean; isOwner?: boolean; onInfoClick?: () => void; onRedrawClick?: () => void; onNextPage?: () => void; onPrevPage?: () => void; } export function ComicCanvas({ page, pageIndex, isLoading = false, isOwner = true, onInfoClick, onRedrawClick, onNextPage, onPrevPage, }: ComicCanvasProps) { const { toast } = useToast(); return (
{/* Dot grid background */}
{`Page { const rect = e.currentTarget.getBoundingClientRect(); const clickX = e.clientX - rect.left; const imageWidth = rect.width; if (clickX > imageWidth / 2) { // Right half - next page onNextPage?.(); } else { // Left half - previous page onPrevPage?.(); } }} />
{/* Page label */}
Page {page.id}
{/* Action buttons below the page image */}
{onInfoClick && ( )} {isOwner && ( )}
{/*
Page {page.id}
*/} {/* Mobile action buttons */}
{isOwner && ( )}
); }