ixoxo's picture
Create App.py
dc9160c verified
import gradio as gr
# Données de démonstration (à personnaliser)
accounts = {
"FR76 3000 4000 1900 0000 1234 C12": {
"balance": "4,589.50 €",
"status": "Actif 🟢",
"type": "Compte Courant"
},
"FR76 3000 4000 1900 0000 5678 C13": {
"balance": "12,300.00 €",
"status": "Actif 🟢",
"type": "Livret A"
},
"FR76 3000 4000 1900 0000 9012 C14": {
"balance": "0.00 €",
"status": "Clos 🔴",
"type": "Compte Épargne"
}
}
def show_account_details(account_number):
account = accounts.get(account_number, {})
return [
account.get("balance", "N/A"),
account.get("type", "N/A"),
account.get("status", "N/A")
]
with gr.Blocks(theme=gr.themes.Soft(primary_hue="green")) as demo:
# ... (ton en-tête existant avec le logo)
# Section Comptes Bancaires
with gr.Accordion("📁 Mes Comptes Bancaires", open=True):
with gr.Row():
account_selector = gr.Dropdown(
label="Sélectionnez un compte",
choices=list(accounts.keys()),
interactive=True
)
with gr.Row():
with gr.Column():
gr.Markdown("### Numéro de Compte")
account_number = gr.Markdown()
with gr.Column():
gr.Markdown("### Solde Disponible")
account_balance = gr.Markdown()
with gr.Column():
gr.Markdown("### Statut du Compte")
account_status = gr.Markdown()
with gr.Column():
gr.Markdown("### Type de Compte")
account_type = gr.Markdown()
# Événement de mise à jour
account_selector.change(
fn=show_account_details,
inputs=account_selector,
outputs=[account_balance, account_type, account_status]
)
# ... (le reste de ton code existant)
demo.launch()