#pragma once

#include <QString>
#include <QWidget>

class QLabel;
class QVBoxLayout;

// A captioned group of parts within a card's configuration or runtime group
// (REQ-UI-SELECTION-CARD): a small heading over whatever the owner puts inside it.
//
// A section and its caption are shown or hidden as one, which is what lets a card list
// its sections unconditionally and simply hide the ones with nothing in them -- a Miner
// consumes nothing, so its input buffer section is never shown.
class SectionBox : public QWidget
{
    Q_OBJECT

public:
    explicit SectionBox(const QString& caption, QWidget* parent = nullptr);

    // The layout to add this section's parts to.
    QVBoxLayout* getContentLayout();

private:
    QLabel*      m_captionLabel;
    QVBoxLayout* m_contentLayout;
};
