#pragma once

#include <QWidget>
#include <QTableView>
#include <QHeaderView>
#include <QSortFilterProxyModel>
#include <QVBoxLayout>
#include <QPushButton>
#include <QLabel>

#include "ui/models/EmailListModel.h"

class MailListView : public QWidget {
    Q_OBJECT

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

    void setModel(EmailListModel *model);

signals:
    void emailSelected(int mailId);
    void emailOpenRequested(int mailId);
    void composeRequested();

private slots:
    void onRowSelected(const QModelIndex &index);

private:
    void setupUI();

    QTableView *m_tableView;
    QSortFilterProxyModel *m_proxyModel;
    QPushButton *m_composeButton;
};