import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
import React from 'react';
import styles from './PixelEditor.module.css.js';
import { NiceButton as We } from '../packages/ui/dist/index.js';

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

export { PixelEditorMenuBar as default };
//# sourceMappingURL=PixelEditorMenuBar.js.map
