diff options
author | polwex <polwex@sortug.com> | 2025-07-16 10:07:06 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-07-16 10:07:06 +0700 |
commit | ff3078e93411c3467d797258744a7f17a7dbdf0a (patch) | |
tree | b13df65dbae32a3298afc0ada39b73a7d8aa469d /app/src/components/counter.tsx | |
parent | b26f4a03e15feddeb4bee8c06cd5078c1a54e5c5 (diff) |
m
Diffstat (limited to 'app/src/components/counter.tsx')
-rw-r--r-- | app/src/components/counter.tsx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/src/components/counter.tsx b/app/src/components/counter.tsx new file mode 100644 index 0000000..0e540b8 --- /dev/null +++ b/app/src/components/counter.tsx @@ -0,0 +1,21 @@ +'use client'; + +import { useState } from 'react'; + +export const Counter = () => { + const [count, setCount] = useState(0); + + const handleIncrement = () => setCount((c) => c + 1); + + return ( + <section className="border-blue-400 -mx-4 mt-4 rounded-sm border border-dashed p-4"> + <div>Count: {count}</div> + <button + onClick={handleIncrement} + className="rounded-xs bg-black px-2 py-0.5 text-sm text-white" + > + Increment + </button> + </section> + ); +}; |