import React from "react";
import Link from "next/link";
import { Redo2, Undo2 } from "lucide-react";
import { UiPreferences } from "../ui-preferences";
import { dividerClass, hoverSubtleClass } from "../../lib/theme";
type EditorHeaderProps = {
isDark: boolean;
projectTitle: string;
canvasWidth: number;
canvasHeight: number;
canUndo: boolean;
canRedo: boolean;
isDirty: boolean;
labels: {
file: string;
edit: string;
view: string;
settings: string;
save: string;
exportPng: string;
exportProjectFile: string;
importImage: string;
canvasSize: string;
undo: string;
redo: string;
copy: string;
cut: string;
paste: string;
preferences: string;
panTool: string;
pointerTool: string;
unsavedChanges: string;
saved: string;
};
onSave: () => void;
onExportPng: () => void;
onExportProjectFile: () => void;
onImportImage: () => void;
onOpenCanvasSize: () => void;
onUndo: () => void;
onRedo: () => void;
onCopy: () => void;
onCut: () => void;
onPaste: () => void;
onSetHandTool: () => void;
onSetPointerTool: () => void;
};
export function EditorHeader({
isDark,
projectTitle,
canvasWidth,
canvasHeight,
canUndo,
canRedo,
isDirty,
labels,
onSave,
onExportPng,
onExportProjectFile,
onImportImage,
onOpenCanvasSize,
onUndo,
onRedo,
onCopy,
onCut,
onPaste,
onSetHandTool,
onSetPointerTool,
}: EditorHeaderProps) {
const menuClass = `absolute left-0 top-full z-30 min-w-[180px] rounded border p-1 text-[11px] opacity-0 shadow-xl transition-opacity pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100 hover:pointer-events-auto hover:opacity-100 ${
isDark ? "border-white/10 bg-[#2a2c31] text-[#e2e5ea]" : "border-black/10 bg-white text-[#1f2430]"
}`;
return (
pien.studio
{projectTitle}
{preferences}