import React, { useState } from "react";
import "./styles.css";

export default function App() {
  const [count, setCount] = useState(0);
  const [text, setText] = useState("");

  return (
    <div className="app">
      <h1>Browser Build Test</h1>
      <div className="counter">
        <button data-testid="decrement" onClick={() => setCount((c) => c - 1)}>
          -
        </button>
        <span data-testid="count">{count}</span>
        <button data-testid="increment" onClick={() => setCount((c) => c + 1)}>
          +
        </button>
      </div>
      <div className="input-section">
        <input
          data-testid="text-input"
          value={text}
          onChange={(e) => setText(e.target.value)}
          placeholder="Type something..."
        />
        <p data-testid="echo">Echo: {text}</p>
      </div>
    </div>
  );
}
