import flet as ft
from pages.settings.documente_juridice import DocumenteJuridice
from pages.settings.users import UsersSettings
from pages.settings.payment_and_subscription import PaymentAndSubscription

class Settings:
    def __init__(self, page: ft.Page, home):
        self.page = page
        self.home = home

        self.doc_juridice = DocumenteJuridice(self.page) 
        self.users_settings = UsersSettings(self.page)
        self.payment_and_subscription = PaymentAndSubscription(self.page)

    def build(self):
        return ft.Tabs(
        selected_index=0,
        length=8,
        expand=True,
        content=ft.Column(
            expand=True,
            controls=[
                ft.TabBar(
                    tabs=[
                        ft.Tab(label="Documente Juridice Standard", icon=ft.Icons.BALANCE),
                        ft.Tab(label="Articole si Publicatii", icon=ft.Icons.ARTICLE),
                        ft.Tab(label="Comunicare", icon=ft.Icons.CHAT),
                        ft.Tab(label="Consultanta", icon=ft.Icons.HANDSHAKE),
                        ft.Tab(label="Convocator", icon=ft.Icons.BUSINESS),
                        ft.Tab(label="Licitatii si Lucrari", icon=ft.Icons.ASSIGNMENT_TURNED_IN),
                        ft.Tab(label="Abonamente si Plati", icon=ft.Icons.REPEAT_ON),
                        ft.Tab(label="Utilizatori", icon=ft.Icons.ADMIN_PANEL_SETTINGS),
                    ]
                ),
                ft.TabBarView(
                    # expand=True,
                    height=300,
                    controls=[
                        ft.Container(
                            content=self.doc_juridice.build(),
                            alignment=ft.Alignment.CENTER,
                            expand=True
                        ),
                        ft.Container(
                            content=ft.Text("This is Tab 2"),
                            alignment=ft.Alignment.CENTER,
                        ),
                        ft.Container(
                            content=ft.Text("This is Tab 3"),
                            alignment=ft.Alignment.CENTER,
                        ),
                        ft.Container(
                            content=ft.Text("This is Tab 4"),
                            alignment=ft.Alignment.CENTER,
                        ),
                        ft.Container(
                            content=ft.Text("This is Tab 5"),
                            alignment=ft.Alignment.CENTER,
                        ),
                        ft.Container(
                            content=ft.Text("This is Tab 6"),
                            alignment=ft.Alignment.CENTER,
                        ),
                        ft.Container(
                            content=self.payment_and_subscription.build(),
                            alignment=ft.Alignment.CENTER,
                        ),
                        ft.Container(
                            content=self.users_settings.build(),
                            alignment=ft.Alignment.CENTER,
                        ),
                    ],
                    expand=True
                ),
            ],
        ),
    )