This commit is contained in:
JOLIMAITRE Matthieu 2024-05-21 18:49:16 +02:00
commit 60133a4a08
23 changed files with 529 additions and 0 deletions

16
islands/Counter.tsx Normal file
View file

@ -0,0 +1,16 @@
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-8 py-6">
<Button onClick={() => props.count.value -= 1}>-1</Button>
<p class="text-3xl tabular-nums">{props.count}</p>
<Button onClick={() => props.count.value += 1}>+1</Button>
</div>
);
}