#ifndef OVERLAY_PANEL_BASE_H
#define OVERLAY_PANEL_BASE_H

#include <QWidget>
#include <QFile>
#include <QString>
#include <QVBoxLayout>
#include <QFormLayout>
#include <QLabel>
#include <modal/Modal.h>

// OverlayPanelBase: Wrapper around SDK's BianbuCC::OverlayPanelBase
// that adds Q_OBJECT and requestClose() signal for compatibility
// with existing bianbu-accounts panels.
class OverlayPanelBase : public BianbuCC::OverlayPanelBase {
    Q_OBJECT
public:
    explicit OverlayPanelBase(const QString &specificQssResource, QWidget *parent = nullptr)
        : BianbuCC::OverlayPanelBase(specificQssResource, parent)
    {
        // Connect the callback to emit signal
        setCloseCallback([this]() { emit requestClose(); });
    }
    
    explicit OverlayPanelBase(QWidget *parent = nullptr)
        : BianbuCC::OverlayPanelBase(parent)
    {
        setCloseCallback([this]() { emit requestClose(); });
    }

signals:
    void requestClose();
};

#endif // OVERLAY_PANEL_BASE_H