import { useSignal } from "@preact/signals";
import { Button } from "../components/ui/button.tsx";

export default function Counter() {
  const count = useSignal<number>(3);
  return (
    <div class="flex gap-8 py-6">
      <Button variant="outline" id="decrement" onClick={() => count.value -= 1}>
        -1
      </Button>
      <p class="text-3xl tabular-nums">{count.value}</p>
      <Button variant="outline" id="increment" onClick={() => count.value += 1}>
        +1
      </Button>
    </div>
  );
}
