import type { Signal } from "@preact/signals"; import { Button } from "@components/Button.tsx"; import { TbCircleMinus, TbCirclePlus } from "@preact-icons/tb"; interface CounterProps { count: Signal; } export default function Counter(props: CounterProps) { props.count.value = Math.max(1, props.count.value); return (
{ const target = ev.target as HTMLInputElement; props.count.value = Math.max(1, Number(target.value)); }} />
); }