| 1 | import { createSignal } from "solid-js"; |
| 2 | |
| 3 | export default function Home() { |
| 4 | const [count, setCount] = createSignal(0); |
| 5 | |
| 6 | return ( |
| 7 | <section class="bg-gray-100 text-gray-700 p-8"> |
| 8 | <h1 class="text-2xl font-bold">Home</h1> |
| 9 | <p class="mt-4">This is the home page.</p> |
| 10 | |
| 11 | <div class="flex items-center space-x-2"> |
| 12 | <button |
| 13 | type="button" |
| 14 | class="border rounded-lg px-2 border-gray-900" |
| 15 | onClick={() => setCount(count() - 1)} |
| 16 | > |
| 17 | - |
| 18 | </button> |
| 19 | |
| 20 | <output class="p-10px">Count: {count()}</output> |
| 21 | |
| 22 | <button |
| 23 | type="button" |
| 24 | class="border rounded-lg px-2 border-gray-900" |
| 25 | onClick={() => setCount(count() + 1)} |
| 26 | > |
| 27 | + |
| 28 | </button> |
| 29 | </div> |
| 30 | </section> |
| 31 | ); |
| 32 | } |