import { IonIcon, IonLabel, IonRouterOutlet, IonTabBar, IonTabButton, IonTabs } from '@ionic/react';

import { cloudOutline, searchOutline } from 'ionicons/icons';
import { Route, Redirect } from 'react-router';

import Tab1 from './AppPages/Tab1';
import Tab2 from './AppPages/Tab2';

import './style.scss';

function DemoWeatherApp() {
  return (
    <IonTabs>
      <IonRouterOutlet>
        <Route exact path="/demo-weather-app/tab1">
          <Tab1 />
        </Route>
        <Route exact path="/demo-weather-app/tab2">
          <Tab2 />
        </Route>

        <Redirect exact path="/demo-weather-app" to="/demo-weather-app/tab1" />
      </IonRouterOutlet>

      {/*  */}
      <IonTabBar slot="bottom">
        <IonTabButton tab="tab1" href="/demo-weather-app/tab1">
          <IonIcon icon={cloudOutline} />
          <IonLabel>Dashboard</IonLabel>
        </IonTabButton>
        <IonTabButton tab="tab2" href="/demo-weather-app/tab2">
          <IonIcon icon={searchOutline} />
          <IonLabel>Search</IonLabel>
        </IonTabButton>
      </IonTabBar>
    </IonTabs>
  );
}

export default DemoWeatherApp;
