// PitStop UI Kit — app shell. Routes between Auth → Dashboard → Trip workspace.

const TRIPS = [
  { name: 'Sardinia Summer 2025', days: 5, stops: 5, range: '14 → 16 Mar', badge: 'Ongoing', people: ['AB', 'MA', 'RK', 'SM'] },
  { name: 'Dolomites Loop', days: 4, stops: 4, range: '2 → 5 Apr', badge: 'In 3 days', badgeAccent: true, people: ['AB', 'RK'] },
  { name: 'Peak District Weekend', days: 2, range: '8 → 9 Feb', people: ['AB', 'MA'] },
];
const ACTIVITIES = [
  { type: 'route', date: 'Sat 12 Jul', title: 'Morning loop', meta: 'Cycling · 42 km planned' },
  { type: 'flight', date: 'Mon 14 Jul', title: 'LGW → OLB', meta: 'Flight · 2h 50m' },
];

function App() {
  const [screen, setScreen] = useState('auth'); // auth | dash | trip
  const [trip, setTrip] = useState(TRIPS[0]);

  return (
    <div style={{ display: 'flex', justifyContent: 'center', padding: '32px 16px', minHeight: '100vh', boxSizing: 'border-box' }}>
      <IOSDevice dark width={390} height={844}>
        {screen === 'auth' && <AuthScreen onSignIn={() => setScreen('dash')} />}
        {screen === 'dash' && <DashboardScreen data={{ trips: TRIPS, activities: ACTIVITIES }} onOpenTrip={(t) => { setTrip(t); setScreen('trip'); }} />}
        {screen === 'trip' && <TripWorkspace trip={trip} onBack={() => setScreen('dash')} />}
      </IOSDevice>
    </div>
  );
}

ReactDOM.createRoot(document.getElementById('root')).render(<App />);
