/** @jsx h */ import { h, IS_BROWSER, tw, useState } from "../client_deps.ts"; import { RoundedButton } from "../components/Button.tsx"; import { IconMinus, IconPlus } from "../components/Icons.tsx"; interface CounterProps { start: number; } export default function Counter(props: CounterProps) { const [count, setCount] = useState(props.start); return (
setCount(count - 1)} disabled={!IS_BROWSER || count <= 0} >
{count}
setCount(count + 1)} disabled={!IS_BROWSER} >
); }