#pragma once

#include <QWidget>
#include <QLabel>
#include <QTextBrowser>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include "core/mailitem.h"

class ReaderView : public QWidget {
    Q_OBJECT

public:
    explicit ReaderView(QWidget *parent = nullptr);
    ~ReaderView() override = default;

    void setMailItem(const MailItem* item);

signals:
    void replyRequested(const MailItem* item);
    void forwardRequested(const MailItem* item);
    void deleteRequested(const MailItem* item);
    void detachRequested();


private:
    void setupUI();

    QLabel *m_subjectLabel;
    QLabel *m_fromLabel;
    QLabel *m_dateLabel;
    QTextBrowser *m_bodyViewer;
    
    QPushButton *m_replyButton;
    QPushButton *m_forwardButton;
    QPushButton *m_deleteButton;
};
