import React, { useState } from 'react';
import Dashboard from './pages/Dashboard';
import Workspace from './pages/Workspace';

function App() {
  const [selectedChallengeId, setSelectedChallengeId] = useState<string | null>(null);

  return (
    <div className="min-h-screen bg-darkBg text-gray-100 font-sans">
      {selectedChallengeId ? (
        <Workspace
          challengeId={selectedChallengeId}
          onBack={() => setSelectedChallengeId(null)}
        />
      ) : (
        <Dashboard
          onSelectChallenge={(id) => setSelectedChallengeId(id)}
        />
      )}
    </div>
  );
}

export default App;
