import React from 'react';
import { Page } from '../Page';
import { Dashboard } from './Dashboard';
import { useUserProfile } from '../../gql/queries/user';
import { WelcomeContent } from './WelcomeContent';

export function HomePage() {
  const { user, loading } = useUserProfile();

  return (
    <Page title={user.id ? 'Tableau de bord' : 'Accueil'}>
      <section className="mt-5">
        {
          user.id ?
          <Dashboard /> :
          <WelcomeContent />
        }
      </section>
    </Page>
  );
}