import type { Signal } from "@preact/signals";
import { Button } from "@components/Button.tsx";

interface CounterProps {
  count: Signal<number>;
}

export default function Counter(props: CounterProps) {
  return (
    <div class="flex gap-2 items-center">
      <Button onClick={() => props.count.value -= 1}>-</Button>
      <p class="text-3xl">{props.count}</p>
      <Button onClick={() => props.count.value += 1}>+</Button>
    </div>
  );
}
