#ifndef CLOUDMODELITEM_H
#define CLOUDMODELITEM_H

#include <QWidget>
#include <QGSettings>
#include <QMouseEvent>
#include <QMenu>
#include <QLabel>
#include <QVariant>
#include <QToolButton>
#include <QHBoxLayout>

#include <aiconfig/modelconfig.h>

#define THEME_QT_SCHEMA  "org.ukui.style"

using namespace std;
using namespace kyai::config::model;

class ModelItem : public QWidget
{
    Q_OBJECT
public:
    explicit ModelItem(AiCapability capability, QString modelName,
                       bool isTrialAccount, QWidget *parent = nullptr);
    ~ModelItem();

    void showSelectedIcon(bool flag);
    bool isSelected();
    AiCapability getAICapability();
    QString getModelName();
    bool isTrialModel();

signals:
    void sigEdit(AiCapability capability, QString modelName);
    void sigDelete(AiCapability capability, QString modelName);

private slots:

private:
    void initLayout();
    void initNameLabel();
    void initMoreButton();
    void initSelectedIconLabel();
    void initMenu();

    QLabel *m_nameLabel = nullptr;        // 模型名称
    QToolButton *m_moreButton = nullptr;  // 更多
    QMenu *m_menu = nullptr;              // 菜单
    QLabel *m_selectedIconLabel = nullptr;// 已选择状态
    kyai::config::model::AiCapability m_capability;
    QString m_modelName;
    bool m_isTrialAccount;
};

#endif // CLOUDMODELITEM_H
