This commit is contained in:
15
frontend/src/components/atom/ButtonDisplayCounter.jsx
Normal file
15
frontend/src/components/atom/ButtonDisplayCounter.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useState } from 'preact/hooks';
|
||||
|
||||
export default function ButtonDisplayCounter() {
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setCount((value) => value + 1)}
|
||||
className="rounded-e-xl border border-border-hairline border-s-0 px-3 py-2 text-xs font-mono text-text-muted hover:bg-canvas-deep"
|
||||
>
|
||||
Clicks: {count}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user