'use strict';

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var PixelEditor_module = require('./PixelEditor.module.css.js');
var index = require('../packages/ui/dist/index.js');

const PixelEditorMenuBar = React.memo(({ api, hasOnSaveToLibrary, onOpenGenerator }) => (jsxRuntime.jsxs("div", { className: PixelEditor_module.menuBar, children: [jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => api.setDlgNew(true), children: "New" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => { var _a; return (_a = api.fInp.current) === null || _a === void 0 ? void 0 : _a.click(); }, children: "Open" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.exportAse, children: "Save .ase" }), jsxRuntime.jsx("div", { className: PixelEditor_module.menuSep }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.exportPNG, children: "PNG" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.exportJPG, children: "JPG" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.exportWebP, children: "WebP" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.exportBMP, children: "BMP" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.exportSVG, children: "SVG" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.exportSheet, children: "Sheet" }), hasOnSaveToLibrary && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: PixelEditor_module.menuSep }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.saveToLibrary, children: "\uD83D\uDCE6 Save to Library" })] })), jsxRuntime.jsx("div", { className: PixelEditor_module.menuSep }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.undo, children: "Undo" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.redo, children: "Redo" }), jsxRuntime.jsx("div", { className: PixelEditor_module.menuSep }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => api.flipCv("h"), children: "Flip H" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => api.flipCv("v"), children: "Flip V" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.rotateCv, children: "Rot 90\u00B0" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.clearCv, children: "Clear" }), jsxRuntime.jsx("div", { className: PixelEditor_module.menuSep }), jsxRuntime.jsxs(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: () => api.setGrid((g) => !g), children: ["Grid: ", api.grid ? "ON" : "OFF"] }), jsxRuntime.jsx("div", { className: PixelEditor_module.menuSep }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.doCopy, disabled: !api.sel, children: "Copy" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.doCut, disabled: !api.sel, children: "Cut" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.doPaste, disabled: !api.clipboard.current, children: "Paste" }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: api.doSelectAll, children: "Sel All" }), jsxRuntime.jsx("div", { className: PixelEditor_module.menuSep }), jsxRuntime.jsx(index.NiceButton, { className: PixelEditor_module.menuBtn, variant: "ghost", size: "sm", onClick: onOpenGenerator, children: "\uD83C\uDFA8 Generator" })] })));
PixelEditorMenuBar.displayName = "PixelEditorMenuBar";

module.exports = PixelEditorMenuBar;
//# sourceMappingURL=PixelEditorMenuBar.js.map
