#ifndef MEETINGSELECTIONWIDGET_H
#define MEETINGSELECTIONWIDGET_H

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QLabel>
#include <QFrame>
#include <QStringList>

class MeetingSelectionWidget : public QWidget
{
    Q_OBJECT

public:
    explicit MeetingSelectionWidget(QWidget *parent = nullptr);
    ~MeetingSelectionWidget();

    // 设置用户角色
    void setUserRoles(const QStringList &roles);
    
    // 设置用户信息
    void setUserInfo(const QString &username, const QString &userId);

signals:
    // 用户选择加入会议
    void joinMeetingRequested();
    
    // 用户选择创建会议
    void createMeetingRequested();
    
    // 用户选择退出登录
    void logoutRequested();

private slots:
    void onJoinMeetingClicked();
    void onCreateMeetingClicked();
    void onLogoutClicked();

private:
    void setupUI();
    void updateButtonsVisibility();
    void applyStyles();

    // UI组件
    QVBoxLayout *m_mainLayout;
    QLabel *m_titleLabel;
    QLabel *m_welcomeLabel;
    QFrame *m_buttonFrame;
    QVBoxLayout *m_buttonLayout;
    QPushButton *m_joinMeetingBtn;
    QPushButton *m_createMeetingBtn;
    QPushButton *m_logoutBtn;
    
    // 用户信息
    QStringList m_userRoles;
    QString m_username;
    QString m_userId;
    
    // 是否为管理员
    bool m_isAdmin;
};

#endif // MEETINGSELECTIONWIDGET_H