from PySide6.QtWidgets import QWidget, QLabel, QVBoxLayout, QHBoxLayout, QPushButton, QComboBox
from PySide6.QtCore import Qt

class StrategyPanel(QWidget):
    def __init__(self):
        super().__init__()
        self.init_ui()

    def init_ui(self):
        layout = QVBoxLayout(self)

        # Title
        title_label = QLabel("Strategies")
        title_label.setAlignment(Qt.AlignCenter)
        title_label.setStyleSheet("font-size: 24px; font-weight: bold; margin-bottom: 20px;")
        layout.addWidget(title_label)

        # Strategy selection and control
        strategy_control_layout = QHBoxLayout()

        strategy_control_layout.addWidget(QLabel("Select Strategy:"))
        self.strategy_selector = QComboBox()
        self.strategy_selector.addItem("Simple Crossover") # Placeholder strategy
        self.strategy_selector.addItem("Intraday FNO") # Placeholder strategy
        strategy_control_layout.addWidget(self.strategy_selector)

        self.start_button = QPushButton("Start Strategy")
        strategy_control_layout.addWidget(self.start_button)

        self.stop_button = QPushButton("Stop Strategy")
        self.stop_button.setEnabled(False) # Initially disabled
        strategy_control_layout.addWidget(self.stop_button)

        layout.addLayout(strategy_control_layout)

        # Strategy status
        status_layout = QHBoxLayout()
        status_layout.addWidget(QLabel("Status:"))
        self.strategy_status_label = QLabel("Idle")
        status_layout.addWidget(self.strategy_status_label)
        status_layout.addStretch(1)
        layout.addLayout(status_layout)

        layout.addStretch(1) # Pushes content to the top
        self.setLayout(layout)