import { useSignal } from "@preact/signals"; import { IS_BROWSER } from "$fresh/runtime.ts"; import { RoundedButton } from "../components/Button.tsx"; import * as Icons from "../components/Icons.tsx"; interface CounterProps { start: number; } export default function Counter(props: CounterProps) { const count = useSignal(props.start); return (

This area is interactive

The server supplied the initial value of 3.

count.value -= 1} disabled={!IS_BROWSER || count.value <= 0} >
{count}
count.value += 1} disabled={!IS_BROWSER} >
); }