Files
pepperplus-ui/src/components/components.tsx
2025-11-26 13:41:18 +00:00

25 lines
639 B
TypeScript

import { useState } from 'react'
/**
* A minimal counter component that demonstrates basic React state handling.
*
* Maintains an internal count value and provides buttons to increment and reset it.
*
* @returns A JSX element rendering the counter UI.
*/
function Counter() {
/** The current counter value. */
const [count, setCount] = useState(0)
return (
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<button className='reset' onClick={() => setCount(0)}>
Reset Counter
</button>
</div>
)
}
export default Counter