File size: 2,021 Bytes
7fed0d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ffe1030
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import streamlit as st
import pandas as pd
import sqlite3
from pathlib import Path
import sys

# Ajouter le répertoire parent au path pour les imports
sys.path.append(str(Path(__file__).parent.parent))

# Configuration de la page
st.set_page_config(
    page_title="U18 Féminines - Stade Toulousain",
    page_icon="./assets/Logo_Stade_Toulousain_Rugby.png",
    layout="wide",
    initial_sidebar_state="expanded"
)

# Charger les styles personnalisés
from utils.styles import load_css, create_rugby_title

# CHARGER LES STYLES CSS
load_css()

# Imports des composants
from components.dashboard import show_dashboard
from components.player_analysis import show_player_analysis
from components.players_comparison import show_players_comparison
from utils.data_loader import load_data

def main():
    # Titre principal
    create_rugby_title("u18 féminines", "Stade Toulousain")

    # Charger les données
    try:
        df = load_data()
    except Exception as e:
        st.error(f"Erreur lors du chargement des données : {e}")
        st.stop()
    

    from streamlit_option_menu import option_menu

    with st.sidebar:
        selected = option_menu( None, 
                ["Tableau de bord", 'Analyse individuelle', 'Comparaison des joueuses'], 
                icons=None, default_index=1,
                menu_icon="cast",
                styles={
                    "container": {"padding": "0!important", "background-color": "#fafafa"},
                    "icon": {"display": "None"}, 
                    "nav-link": {"font-size": "16px", "text-align": "left", "margin":"3px", "--hover-color": "#eee"},
                    "nav-link-selected": {"background-color": "#000000"},
                }
            )
    # Affichage des pages
    if selected == "Tableau de bord":
        show_dashboard(df)
    elif selected == "Analyse individuelle":
        show_player_analysis(df)
    elif selected == "Comparaison joueuses":
        show_players_comparison(df)

if __name__ == "__main__":
    main()