#ifndef SENSORWIDGET_H
#define SENSORWIDGET_H

#include <QFrame>
#include <QLabel>
#include <QVBoxLayout>

class SensorWidget : public QFrame
{
    Q_OBJECT

public:
    //Конструктор
    explicit SensorWidget(QWidget *parent = nullptr,
                          const QString &title = "Default sensor",
                          const QString &value = "1.01 #",
                          const QString &incident = "Default incident");

    // Метод для изменения внешнего вида при ошибке
    void setErrorState(bool hasError,
                       const QString &title = "Default error",
                       const QString &value = "Default error",
                       const QString &incident = "123 - 123");

private:
    QLabel *titleLabel;
    QLabel *valueLabel;
    QLabel *incidentLabel;
    QVBoxLayout *layout;
};

#endif // SENSORWIDGET_H
