#pragma once

#include <vector>

#include <QPixmap>

#include "entt/entity/entity.hpp"

#include "SelectionContent.h"
#include "SelectionContentFactory.h"

class StatRow;

// The card for selected debris (REQ-UI-DEBRIS-PANEL): the scrap still left in it.
//
// It is the field category's aggregating content (REQ-UI-SELECTION-AGGREGATE): several
// pieces of debris show this same card with the count in the header and their scrap
// summed, because that is the one value the card holds and it adds up.
class DebrisContent : public SelectionContent
{
    Q_OBJECT

public:
    DebrisContent(const SelectionContext& context, const SelectionRequest& request,
                  QWidget* parent = nullptr);

protected:
    void refreshRuntime() override;

private:
    std::vector<entt::entity> m_debris;
    StatRow*                  m_scrapRow;
    // The bare scrap icon the row states its amount with, or null where there is no icon
    // file and the row names the item in words instead (REQ-UI-DEBRIS-PANEL). Taken once:
    // it depends on the card's font, not on the value.
    QPixmap                   m_scrapIcon;
};
