2025-12-13 14:09:00 +01:00
|
|
|
import * as React from 'react';
|
|
|
|
|
import {createRoot} from 'react-dom/client';
|
|
|
|
|
|
|
|
|
|
import '../src/assets/style.css';
|
2025-12-13 22:02:20 +01:00
|
|
|
import TodoChoppers from '../src/assets/todo-choppers.gif';
|
2025-12-13 14:09:00 +01:00
|
|
|
import { findExistingAxe } from '.';
|
|
|
|
|
|
|
|
|
|
const App: React.FC = () => {
|
|
|
|
|
const addAxe = async () => {
|
|
|
|
|
var axe = await findExistingAxe()
|
|
|
|
|
if (!axe) {
|
|
|
|
|
axe = await miro.board.createImage({
|
|
|
|
|
url: 'https://www.svgrepo.com/show/395800/axe.svg',
|
|
|
|
|
width: 200,
|
|
|
|
|
title: 'todo-tree-axe'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await miro.board.viewport.zoomTo(axe);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
2025-12-13 22:02:20 +01:00
|
|
|
<div>
|
|
|
|
|
<img src={TodoChoppers}/>
|
2025-12-13 14:09:00 +01:00
|
|
|
<button className="button button-primary" onClick={addAxe}>
|
|
|
|
|
Create Axe
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const container = document.getElementById('root');
|
|
|
|
|
if (container) {
|
|
|
|
|
const root = createRoot(container);
|
|
|
|
|
root.render(<App />);
|
|
|
|
|
}
|