import { useCallback, useState } from 'react';
import ExpensiveList from './ExpensiveList';
import './App.css';

function App() {
  const [count, setCount] = useState(0);

  const handleSelect = useCallback((id: number) => {
    console.log('Selected', id);
  }, []);

  return (
    <div>
      <h2>Count: {count}</h2>
      <button onClick={() => setCount((c) => c + 1)}>Increment</button>

      <ExpensiveList onSelect={handleSelect} />
    </div>
  );
}

export default App;

