"use client"; import type { ChangeEvent } from "react"; import type { MapImageOverlay } from "@/uhm/components/map/imageOverlay"; type Props = { overlay: MapImageOverlay | null; onPickImage: (file: File | null) => void; onPasteImage: () => void; keyboardEnabled: boolean; onKeyboardEnabledChange: (enabled: boolean) => void; onOpacityChange: (opacity: number) => void; onRemove: () => void; }; export default function ImageOverlayPanel({ overlay, onPickImage, onPasteImage, keyboardEnabled, onKeyboardEnabledChange, onOpacityChange, onRemove, }: Props) { const handleFileChange = (event: ChangeEvent) => { const file = event.target.files?.[0] || null; onPickImage(file); event.target.value = ""; }; return (
Trace Image
Chuột phải kéo điểm vàng để di chuyển, điểm xanh để kéo dãn giữ ratio. {keyboardEnabled ? " WASD di chuyển, Q/E phóng to/thu nhỏ." : ""}
{overlay ? ( ) : null}
{overlay ? (
{overlay.name}
) : (
Chưa có ảnh overlay.
)}
); } const uploadButtonStyle = { display: "inline-flex", alignItems: "center", justifyContent: "center", border: "1px solid #334155", borderRadius: 6, background: "#111827", color: "#93c5fd", cursor: "pointer", fontSize: 12, fontWeight: 800, padding: "7px 10px", } as const; const dangerButtonStyle = { border: "1px solid #7f1d1d", borderRadius: 6, background: "#1f1111", color: "#fecaca", cursor: "pointer", fontSize: 12, fontWeight: 800, padding: "6px 8px", } as const;