import { render } from 'preact';
import { useState } from 'preact/hooks';
import { html } from 'htm/preact';

export function Counter() {
	const [count, setCount] = useState(0);

	return html`
		<div class="counter-container">
			<button onClick=${() => setCount(count + 1)}>Increment</button>
			<input readonly value=${count} />
			<button onClick=${() => setCount(count - 1)}>Decrement</button>
		</div>
	`;
}

render(<Counter />, document.getElementById('app'));
