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 DemoReactCalculator() {
  return (
    <IonTabs>
      <IonRouterOutlet>
        <Route exact path="/demo-react-calculator/tab1">
          <Tab1 />
        </Route>
        <Route exact path="/demo-react-calculator/tab2">
          <Tab2 />
        </Route>

        <Redirect exact path="/demo-react-calculator" to="/demo-react-calculator/tab1" />
      </IonRouterOutlet>

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

export default DemoReactCalculator;
