| 1 | "use client"; |
| 2 | |
| 3 | import { useState } from "react"; |
| 4 | |
| 5 | export function Counter() { |
| 6 | const [count, setCount] = useState(0); |
| 7 | |
| 8 | return ( |
| 9 | <div className="mt-4"> |
| 10 | <p data-testid="count">Count: {count}</p> |
| 11 | <button |
| 12 | className="mt-2 rounded-md border border-slate-200 bg-white px-3 py-1.5 text-sm text-slate-900 hover:bg-slate-50" |
| 13 | data-testid="increment" |
| 14 | type="button" |
| 15 | onClick={() => setCount((c) => c + 1)} |
| 16 | > |
| 17 | Increment |
| 18 | </button> |
| 19 | </div> |
| 20 | ); |
| 21 | } |